JavaScript-Developer-I Dumps

JavaScript-Developer-I Free Practice Test

Salesforce JavaScript-Developer-I: Salesforce Certified JavaScript Developer I

QUESTION 26

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

Correct Answer: AC

QUESTION 27

Refer to the HTML below:



  • Leo

  • Tony

  • Tiger



Which JavaScript statementresults in changing “ Tony” to “Mr. T.”?

Correct Answer: D

QUESTION 28

Refer to the code below:
JavaScript-Developer-I dumps exhibit
Which code executes sayHello once, two minutes from now?

Correct Answer: A

QUESTION 29

Which statement accurately describes the behaviour of the async/ await keyworks ?

Correct Answer: B

QUESTION 30

Refer to the code below:
Let car1 = new Promise((_ , reject) => setTimeout(reject, 2000, “car 1 crashed in” =>
Let car2 =new Promise(resolve => setTimeout(resolve, 1500, “car 2 completed”) Let car3 =new Promise(resolve => setTimeout(resolve, 3000, “car 3 completed”) Promise.race(( car1, car2, car3))
.t hen (value => (
Let result = ‘$(value) the race.’;)}
.catch(arr => {
console.log(“Race is cancelled.”, err);
});
What isthe value of result when Promise.race executes?

Correct Answer: B