Free Certified JavaScript Developer I Exam Braindumps (page: 15)

Page 14 of 57

Which statement accurately describes an aspect of promises?

  1. Arguments for the callback function passed to .then() are optional.
  2. In a.then() function, returning results is not necessary since callbacks will catch the result of a previous promise.
  3. .then() cannot be added after a catch.
  4. .then() manipulates and returns the original promise.

Answer(s): A



Given the code below:
FunctionmyFunction(){
A =5;
Var b =1;
}
myFunction();

console.log(a);
console.log(b);
What is the expected output?

  1. Both lines 08 and 09 are executed, and the variables are outputted.
  2. Line 08 outputs the variable, but line 09 throws an error.
  3. Line 08thrones an error, therefore line 09 is never executed.
  4. Both lines 08 and 09 are executed, but values outputted are undefined.

Answer(s): B



Which two console logs outputs NaN ?
Choose 2 answers

  1. console.log(10/ Number(`5'));
  2. console.log(parseInt(`two'));
  3. console.log(10/ `'five);
  4. console.log(10/0);

Answer(s): B,C



Given the following code:
Counter = 0;
const logCounter = () => {
console.log(counter);
);
logCounter();
setTimeout(logCOunter, 1100);
setInterval(() => {
Counter++
logCounter();
}, 1000);
What is logged by the first four log statements?

  1. 0 0 1 2
  2. 0 1 2 3
  3. 0 1 1 2
  4. 0 1 2 2

Answer(s): C






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

Exam Discussions & Posts