Free CRT-600 Exam Braindumps (page: 24)

Page 23 of 57

Refer 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. Undefined
  2. Line 13 throws an error.
  3. `Undefined values!'
  4. `Null value!'

Answer(s): C



Which code statement below correctly persists an objects in local Storage ?

  1. const setLocalStorage = (storageKey, jsObject) => {
    window.localStorage.setItem(storageKey, JSON.stringify(jsObject)); }
  2. const setLocalStorage = ( jsObject) => {
    window.localStorage.connectObject(jsObject));
    }
  3. const setLocalStorage = ( jsObject) => {
    window.localStorage.setItem(jsObject);
    }
  4. const setLocalStorage = (storageKey, jsObject) => {
    window.localStorage.persist(storageKey, jsObject);
    }

Answer(s): A



Given the code below:
const copy = JSON.stringify([ new String(` false '), new Bollean( false ), undefined ]);

What is the value of copy?

  1. -- [ \"false\" , { } ]--
  2. -- [ false, { } ]--
  3. -- [ \"false\" , false, undefined ]--
  4. -- [ \"false\" ,false, null ]--

Answer(s): D



The developer wants to test the array shown:
const arr = Array(5).fill(0)
Which two tests are the most accurate for this array ? Choose 2 answers:

  1. console.assert( arr.length === 5 );
  2. arr.forEach(elem => console.assert(elem === 0)) ;
  3. console.assert(arr[0] === 0 && arr[ arr.length] === 0);
  4. console.assert (arr.length >0);

Answer(s): A,B






Post your Comments and Discuss Salesforce CRT-600 exam with other Community members:

CRT-600 Discussions & Posts