Free JavaScript-Developer-I Exam Braindumps

Pass your Salesforce Certified JavaScript Developer I exam with these free Questions and Answers

Page 5 of 44
QUESTION 16

Which code statement correctly retrieves and returns an object from localStorage?

  1. A. const retrieveFromLocalStorage = () =>{return JSON.stringify(window.localStorage.getItem(storageKey));}JavaScript-Developer-I dumps exhibit
  2. B. const retrieveFromLocalStorage = (storageKey) =>{ return window.localStorage.getItem(storageKey);}JavaScript-Developer-I dumps exhibit
  3. C. const retrieveFromLocalStorage = (storageKey) =>{ returnJSON.parse(window.localStorage.getItem(storageKey));}JavaScript-Developer-I dumps exhibit
  4. D. const retrieveFromLocalStorage = (storageKey) =>{ return window.localStorage[storageKey];}JavaScript-Developer-I dumps exhibit

Correct Answer: C

QUESTION 17

Which statement phrases successfully?

  1. A. JSON.parse ( ‘ foo ’ );
  2. B. JSON.parse ( “ foo ” );
  3. C. JSON.parse( “ ‘ foo ’ ” );
  4. D. JSON.parse(‘ “ foo ” ’);

Correct Answer: D

QUESTION 18

What are two unique features of functions defined with a fat arrow as compared to normal function definition?
Choose 2 answers

  1. A. The function generated its own this making ituseful for separating the function’s scope from its enclosing scope.
  2. B. The function receives an argument that is always in scope, called parentThis, which is the enclosing lexical scop
  3. C. If the function has a single expression in the function body, the expression will be evaluated and implicit returned.
  4. D. The function uses the this from the enclosing scope.

Correct Answer: AC

QUESTION 19

A developer needs to test this function:
01const sum3 = (arr) => (
02if (!arr.length) return 0,
03if (arr.length === 1) return arr[0],
04if (arr.length === 2) return arr[0]+ arr[1],
05 return arr[0] + arr[1] + arr[2],
06 );
Which two assert statements are valid tests for the function? Choose 2 answers

  1. A. console.assert(sum3(1, ‘2’)) == 12);
  2. B. console.assert(sum3(0)) == 0);
  3. C. console.assert(sum3(-3, 2 )) == -1);
  4. D. console.assert(sum3(‘hello’, 2, 3, 4)) === NaN);

Correct Answer: AC

QUESTION 20

Refer to code below:
Let productSKU = ‘8675309’ ;
A developer has a requirement to generate SKU numbers that are always 19 characters lon, starting with ‘sku’,and padded with zeros.
Which statement assigns the values sku0000000008675309 ?

  1. A. productSKU = productSKU .padStart (19. ‘0’).padstart(‘sku’);
  2. B. productSKU = productSKU .padEnd (16. ‘0’).padstart(‘sku’);
  3. C. productSKU = productSKU .padEnd (16. ‘0’).padstart(19, ‘sku’);
  4. D. productSKU = productSKU .padStart (16. ‘0’).padstart(19, ‘sku’);

Correct Answer: D

Page 5 of 44

Post your Comments and Discuss Salesforce JavaScript-Developer-I exam with other Community members: