¡GoConqr estrena diseño! Cuéntanos qué te parece.

Test

Salesforce JavaScript Developer I

Dani Armngd 57 preguntas

Hacer el test

Preguntas del test (57)

  1. 1Refer to the code below:

    Let str = ‘javascript’;

    Str[0] = ‘J’;

    Str[4] = ’S’;

    After changing the string index values, the value of str is ‘javascript’.

    What is the reason for this value:

    1. ANon-primitive values are mutable.
    2. BNon-primitive values are immutable.
    3. CPrimitive values are mutable.
    4. DPrimitive values are immutable.
  2. 22. What are two unique features of functions defined with a fat arrow as compared to normal function definition? Choose 2 answers
    1. AThe function generated its own this making it useful for separating the function’s scope from its enclosing scope.
    2. BIf the function has a single expression in the function body, the expression will be evaluated and implicit returned.
    3. CThe function receives an argument that is always in scope, called parentThis, which is the enclosing lexical scope.
    4. DThe function uses the this from the enclosing scope.
  3. 3Refer to the code below:

    const event = new CustomEvent(

    //Missing Code

    );

    obj.dispatchEvent(event);

    A developer needs to dispatch a custom event called update to send information about recordId.

    Which two options could a developer insert at the placeholder in line 02 to achieve this? Choose 2 answers
    1. A‘Update’ , (
      recordId : ‘123abc’
      (
    2. Bcorrect
      ‘Update’ , ‘123abc’
      { type : ‘update’, recordId : ‘123abc’ }
    3. C‘Update’ , {
      Details : {
      recordId : ‘123abc’
      }
      }
  4. 4At Universal Containers, every team has its own way of copying JavaScript objects.

    The code Snippet shows an implementation from one team:

    Function Person() {

    this.firstName = “John”;

    this.lastName = ‘Doe’;

    This.name =() => (

    console.log(‘Hello $(this.firstName) $(this.firstName)’);

    )}

    Const john = new Person ();

    Const dan = JSON.parse(JSON.stringify(john));

    dan.firstName =’Dan’;

    dan.name();

    What is the Output of the code execution?
    1. AHello Dan Doe
    2. BHello John DOe
    3. CTypeError: dan.name is not a function
    4. DTypeError: Assignment to constant variable
  5. 5Refer to the code below:

    catch( arr => (

    10 console.log(“Race is cancelled.”, err);

    11 ));

    What is the value of result when Promise.race executes?
    1. ACar 3 completed the race.
    2. BCar 1 crashed in the race.
    3. CCar 2 completed the race.
    4. DRace is cancelled.
  6. 6Given the code below:

    Function myFunction(){

    A =5; Var b =1;

    }

    myFunction();

    console.log(a);

    console.log(b);

    What is the expected output?
    1. ABoth lines 08 and 09 are executed, and the variables are outputted.
    2. BLine 08 outputs the variable, but line 09 throws an error.
    3. CLine 08 thrones an error, therefore line 09 is never executed.
    4. DBoth lines 08 and 09 are executed, but values outputted are undefined.
  7. 7Refer to the following code:

    function test (val) {

    If (val === undefined) {

    return ‘Undefined values!’ ;

    }

    if (val === null) {

    return ‘Null value! ’;

    }

    return val;

    }

    Let x;

    test(x);

    What is returned by the function call on line 13?
    1. AUndefined
    2. BLine 13 throws an error.
    3. C‘Undefined values!’
    4. D‘Null value!’
  8. 8CORRECT TEXT

    Given the requirement to refactor the code above to JavaScript class format, which class definition is correct?
    A)

    B)

    C)

    D)
    1. AOption A
    2. BOption B
    3. COption C
    4. DOption D
  9. 9Refer to the code below:

    Async funct on functionUnderTest(isOK) {

    If (isOK) return ‘OK’ ;

    Throw new Error(‘not OK’);

    )

    Which assertion accuretely tests the above code?
    1. AConsole.assert (await functionUnderTest(true), ‘ OK ’)
    2. BConsole.assert (await functionUnderTest(true), ‘ not OK ’)
    3. CConsole.assert (await functionUnderTest(true), ‘not OK’)
    4. DConsole.assert (await functionUnderTest(true), ‘OK’)
  10. 10Which two code snippets show working examples of a recursive function? Choose 2 answers
    1. ALet countingDown = function(startNumber) { If ( startNumber >0) { console.log(startNumber) ; return countingDown(startNUmber); } else { return startNumber; }};
    2. BFunction factorial ( numVar ) { If (numVar < 0) return; If ( numVar === 0 ) return 1; return numVar -1;
    3. CConst sumToTen = numVar => { If (numVar < 0) Return; return sumToTen(numVar + 1)};
    4. DConst factorial =numVar => { If (numVar < 0) return; If ( numVar === 0 ) return 1; return numVar * factorial ( numVar - 1 ); };

Información

Descripción
test exam
Idioma
Español
Visitas
458
Valoración
Aún sin valoraciones
Valora este test
Valora este test

Escríbenos

¿Sobre qué es tu mensaje?

¿Qué te parece el nuevo diseño?

¿Te gusta?