Practice Free Salesforce Certified JavaScript Developer Exam Online Questions
Referto the code below:
new Promise((resolve, reject) => {
const fraction = Math.random();
if( fraction >0.5) reject("fraction > 0.5, " + fraction);
resolve(fraction);
})
.then(() =>console.log("resolved"))
.catch((error) => console.error(error))
.finally(() =>console.log(" when am I called?"));

When does Promise.finally on line 08 get called?
- A . When rejected
- B . When resolved and settled
- C . When resolved
- D . When resolved or rejected
Given the following code:
let x = null;
console.log(typeof x);
What is the output?
- A . "object"
- B . "undefined"
- C . "null"
- D . "x"
Given the following code:

What will be the first four numbers logged?
- A . 0012
- B . 0112
- C . 0122
- D . 0123
Refer to the code below:
Const pi = 3.1415326,
What is the data type of pi?
- A . Double
- B . Number
- C . Decimal
- D . Float
Given the following code, what is the value of x?
let x = ‘15′ + (10 * 2);
- A . 35
- B . 50
- C . 1520
- D . 3020
Given the HTML below:

Which statement adds the priority-account CSS class to the Universal Containers row?
- A . document. querySelector (#row-uc’).classes-push(‘priority-account’);
- B . document. getElementByid(‘row-uc’).addClass(‘priority-account*);
- C . document. querySelectorAll(‘#row-uc’) -classList.add("priority-accour’);
- D . document. queryselector(‘#row-uc’).ClassList.add(‘priority-account’);
A developer is leading the creation of a new browser application that will serve a single page application. The team wants to use a new web framework Minimalsit.js. The Lead developer wants to advocate for a more seasoned web framework that already has a community around it.
Which two frameworks should the lead developer advocate for? Choose 2 answers
- A . Vue
- B . Angular
- C . Koa
- D . Express
The developer wants to test this code:
Const toNumber =(strOrNum) => strOrNum;
Which two tests are most accurate for this code? Choose 2 answers
- A . console.assert(toNumber(‘2’) === 2);
- B . console.assert(Number.isNaN(toNumber()));
- C . console.assert(toNumber(‘-3’) < 0);
- D . console.assert(toNumber () === NaN);
Which javascript methods can be used to serialize an object into a string and deserialize a JSON string into an object, respectively?
- A . JSON.stringify and JSON.parse
- B . JSON.serialize and JSON.deserialize
- C . JSON.encode and JSON.decode
- D . JSON.parse and JSON.deserialize
Refer to the following object.

How can a developer access the full Name property for dog?
- A . Dog.fullName
- B . Dog.fullName ()
- C . Dog, get,fullName
- D . Dog, function, fullName
