Refer to the code below:
01 let car1 = new promise((_, reject) =>
02 setTimeout(reject, 2000, ''Car 1 crashed in''));
03 let car2 = new Promise(resolve => setTimeout(resolve, 1500, ''Car 2
completed''));
04 let car3 = new Promise(resolve => setTimeout (resolve, 3000, ''Car 3
Completed''));
05 Promise.race([car1, car2, car3])
06 .then(value => (
07 let result = $(value) the race. `;
08 ))
09 .catch( arr => (
10 console.log(''Race is cancelled.'', err);
11 ));
What is the value of result when Promise.race executes?
Answer : C
Refer to the HTML below:
Which JavaScript statement results in changing '' Tony'' to ''Mr. T.''?
Answer : D
A developer wants to define a function log to be used a few times on a single-file JavaScript script.
01 // Line 1 replacement
02 console.log('"LOG:', logInput);
03 }
Which two options can correctly replace line 01 and declare the function for use?
Choose 2 answers
Answer : A, C
A developer wants to create an object from a function in the browser using the code
below:
Function Monster() { this.name = 'hello' };
Const z = Monster();
What happens due to lack of the new keyword on line 02?
Answer : C
developer is trying to convince management that their team will benefit from using
Node.js for a backend server that they are going to create. The server will be a web server that
handles API requests from a website that the team has already built using HTML, CSS, and
JavaScript.
Which three benefits of Node.js can the developer use to persuade their manager?
Choose 3 answers:
Answer : A, C, E
A class was written to represent items for purchase in an online store, and a second class
Representing items that are on sale at a discounted price. THe constructor sets the name to the
first value passed in. The pseudocode is below:
Class Item {
constructor(name, price) {
... // Constructor Implementation
}
}
Class SaleItem extends Item {
constructor (name, price, discount) {
...//Constructor Implementation
}
}
There is a new requirement for a developer to implement a description method that will return a
brief description for Item and SaleItem.
Let regItem =new Item('Scarf', 55);
Let saleItem = new SaleItem('Shirt' 80, -1);
Item.prototype.description = function () { return 'This is a ' + this.name;
console.log(regItem.description());
console.log(saleItem.description());
SaleItem.prototype.description = function () { return 'This is a discounted ' +
this.name; }
console.log(regItem.description());
console.log(saleItem.description());
What is the output when executing the code above ?
Answer : B
Refer to the code below:

Considering that JavaScript is single-threaded, what is the output of line 08 after the code executes?
Answer : B