Which three browser specific APIs are available for developers to persist data between page loads?
Function to test:
01 const sum3 = (arr) = > {
02 if (!arr.length) return 0;
03 if (arr.length === 1) return arr[0];
04 if (arr.length === 2) return arr[0] + arr[1] ;
05 return arr[0] + arr[1] + arr[2];
06 };
Which two assert statements are valid tests for this function?
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?
Refer to the following code (correcting the missing template literal backticks):
let codeName = ' Bond ' ;
let sampleText = `The name is ${codeName}, Jim ${codeName}`;
A developer is trying to determine if a certain substring is part of a string.
Which three code statements return true?
Console logging methods that allow string substitution:
Given the code below:
01 function Person(name, email) {
02 this.name = name;
03 this.email = email;
04 }
05
06 const john = new Person( ' John ' , ' john@email.com ' );
07 const jane = new Person( ' Jane ' , ' jane@email.com ' );
08 const emily = new Person( ' Emily ' , ' emily@email.com ' );
09
10 let usersList = [john, jane, emily];
Which method can be used to provide a visual representation of the list of users and to allow sorting by the name or email attribute?
Refer to the following object:
01 const cat = {
02 firstName: ' Fancy ' ,
03 lastName: ' Whiskers ' ,
04 get fullName(){
05 return this.firstName + ' ' + this.lastName;
06 }
07 };
How can a developer access the fullName property for cat?
Corrected code:
let obj = {
foo: 1,
bar: 2
};
let output = [];
for (let something in obj) {
output.push(something);
}
console.log(output);
What is the output of line 11?
A developer wrote the following code:
01 let x = object.value;
02
03 try {
04 handleObjectValue(x);
05 } catch(error) {
06 handleError(error);
07 }
The developer has a getNextValue function to execute after handleObjectValue(), but does not want to execute getNextValue() if an error occurs. How can the developer change the code to ensure this behavior?
Considering type coercion, what does the following expression evaluate to?
true + ' 13 ' + NaN
TESTED 30 May 2026