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

Page 1 of 20

A developer is wondering whether to use, promise, then or provise, catch especially when a promise throws an error.

Which two promises are rejected? Choose 2 answers

  1. Promise, rejected (Cool error here'), then (error => console (error ));
  2. New promise (() => (throw `Cool error here `)) , then ((null, error => console, (error)));
  3. New Promise((resolve, reject) => ( throw `Cool error here')) .catch (error => console (error ));
  4. Promise , reject (`Cool error here `) , catch (error => console ,error (error));

Answer(s): B,C



Refer to the code below:



What is the output if this function when called with an empty array?

  1. Retruns 0
  2. Throws an error
  3. Return 10
  4. Return NaN

Answer(s): C



Refer to the code below:



A developer uses a client that makes a GET request that uses a promise to handle the request, getRequest returns a promise.

Which code modification can the developer make to gracefully handle an error?

A)


B)


C)


D)

  1. Option A
  2. Option B
  3. Option C
  4. Option D

Answer(s): A



Refer to the following code that performs a basis mathematical operation on a provided input:



How should line o2 be written to ensure that x evaluated to 6 in the line below?

Let x calculate (`'g'');

  1. Return Number (num + 10) / 3;
  2. Return Number (num) + 10) / 3);
  3. Return integer (num + 10) / 3;
  4. Return Number (num + 10) / 3;

Answer(s): B






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

Certified JavaScript Developer I Discussions & Posts