Refer to the code:
const pi = 3.1415926;
What is the data type of pi?
Refer to the code below:
01 let country = {
02 get capital() {
03 let city = Number( " London " );
04
05 return {
06 cityString: city.toString(),
07 }
08 }
09 }
Which value can a developer expect when referencing country.capital.cityString?
A developer implements a function that adds a few values.
function sum(num1, num2, num3) {
if (num3 === undefined) {
num3 = 0;
}
return num1 + num2 + num3;
}
Which three options can the developer invoke for this function to get a return value of 10?
A developer wants to catch any error that countSheep() may throw and pass it to handleError().
Which implementation is correct?
Refer to the code below (corrected to use a template literal on line 08):
01 let car1 = new Promise((_, reject) = >
02 setTimeout(reject, 2000, " Car 1 crashed in " )
03 );
04 let car2 = new Promise(resolve = >
05 setTimeout(resolve, 1500, " Car 2 completed " )
06 );
07 let car3 = new Promise(resolve = >
08 setTimeout(resolve, 3000, " Car 3 completed " )
09 );
10
11 Promise.race([car1, car2, car3])
12 .then(value = > {
13 let result = `${value} the race.`;
14 })
15 .catch(err = > {
16 console.log( " Race is cancelled. " , err);
17 });
What is the value of result when Promise.race executes?
Refer to the code below:
01 const addBy = ?
02 const addByEight = addBy(8);
03 const sum = addByEight(50);
Which two functions can replace line 01 and return 58 to sum?
Which two implementations of utils.js support foo and bar?
Refer to the HTML below:
< div id= " main " >
< ul >
< li > Leo < /li >
< li > Tony < /li >
< li > Tiger < /li >
< /ul >
< /div >
Which JavaScript statement results in changing " Leo " to " The Lion " ?
Refer to the code below:
class Student {
constructor(name) {
this._name = name;
}
displayGrade() {
console.log(`${this._name} got 70% on test.`);
}
}
class GraduateStudent extends Student {
constructor(name) {
super(name);
this._name = " Graduate Student " + name;
}
displayGrade() {
console.log(`${this._name} got 100% on test.`);
}
}
let student = new GraduateStudent( " Jane " );
student.displayGrade();
What is the console output?
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?
|
PDF + Testing Engine
|
|---|
|
$49.5 |
|
Testing Engine
|
|---|
|
$37.5 |
|
PDF (Q&A)
|
|---|
|
$31.5 |
Salesforce Free Exams |
|---|
|