MultipleChoice
Most accurate tests for const arr = Array(5).fill(0);:
OptionsMultipleChoice
static delay = async delay => {
return new Promise(resolve => {
setTimeout(resolve, delay);
});
};
static asyncCall = async () => {
await delay(1000);
console.log(1);
};
console.log(2);
asyncCall();
console.log(3);
(Assume delay and asyncCall are in scope as functions.)
What is logged to the console?
OptionsMultipleChoice
Refer to the code snippet:
01 let array = [1, 2, 3, 4, 4, 5, 4, 4];
02 for (let i = 0; i < array.length; i++) {
03 if (array[i] === 4) {
04 array.splice(i, 1);
05 i--;
06 }
07 }
What is the value of array after the code executes?
OptionsMultipleChoice
Refer to the code below:
const pi = 3.1415926;
What is the data type of pi?
OptionsMultipleChoice
At Universal Containers, every team has its own way of copying JavaScript objects. The code snippet shows an implementation from one team:
01 function Person() {
02 this.firstName = "John";
03 this.lastName = "Doe";
04 this.name = () => {
05 console.log('Hello ${this.firstName} ${this.lastName}');
06 }
07 }
08
09 const john = new Person();
10 const dan = JSON.parse(JSON.stringify(john)); // (intended deep copy)
11 dan.firstName = 'Dan';
12 dan.name();
(Original line 10 is logically intended to be JSON.parse(JSON.stringify(john)) to perform a JSON clone.)
What is the output of the code execution?
OptionsMultipleChoice
Given the HTML below:
Which statement adds the priority-account CSS class to the Applied Shipping row?
Options