Refer to the following code:
What is the output of line 11?
Answer : D
Refer tofollowing code:
class Vehicle {
constructor(plate) {
This.plate =plate;
}
}
Class Truck extends Vehicle {
constructor(plate, weight) {
//Missing code
This.weight = weight;
}
displayWeight() {
console.log('The truck ${this.plate} has a weight of${this.weight} lb.');}}
Let myTruck = new Truck('123AB', 5000);
myTruck.displayWeight();
Which statement should be added to line 09 for the code to display 'The truck 123AB has a
weight of 5000lb.'?
Answer : B
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
Given the code below:
const delay = async delay =>{
return new Promise((resolve,reject)=>{
console.log(1);
setTimeout(resolve,deleay);
});
};
const callDelay =async ()=>{
console.log(2);
const yup = await delay(1000);
console.log(3);
}
console.log(4);
callDelay();
console.log(5);
What is logged to the console?
Answer : A
A developer creates a genericfunction to log custom messages in the console. To do this,
the function below is implemented.
01 function logStatus(status){
02 console./*Answer goes here*/{'Item status is: %s', status};
03 }
Which three console logging methods allow the use of string substitution in line 02?
Answer : B, D, E
At Universal Containers, every team has its own way of copying JavaScript objects. The
code
Snippet shows an implementation from one team:
Function Person() {
this.firstName = ''John'';
this.lastName = 'Doe';
This.name =() => (
console.log('Hello $(this.firstName) $(this.firstName)');
)}
Const john = new Person ();
Const dan =JSON.parse(JSON.stringify(john));
dan.firstName ='Dan';
dan.name();
What is the Output of the code execution?
Answer : C
Given the HTML below:
Which statement adds the priority-account css class to the Applied Shipping row?
Answer : A