Refer to the code below:
Const resolveAfterMilliseconds = (ms) => Promise.resolve (
setTimeout ((=> console.log(ms), ms ));
Const aPromise = await resolveAfterMilliseconds(500);
Const bPromise = await resolveAfterMilliseconds(500);
Await aPromise, wait bPromise;
What is the result of running line 05?
The developer wants to test the array shown:
const arr = Array(5).fill(0)
Which two tests are the most accurate for this array ?
Choose 2 answers:
A developer wants to use a module called DataPrettyPrint. This module exports one default functioncalled printDate ().
How can a developer import and use the printDate() function?
A)
B)
C)
D)
A developer wants to create an object from a function in the browser using the code below.
What happens due to the lack of the mm keyword on line 02?
Refer to the code below:
let o = {
get js() {
let city1 = String("st. Louis");
let city2 = String(" New York");
return {
firstCity: city1.toLowerCase(),
secondCity: city2.toLowerCase(),
}
}
}
What value can a developer expect when referencing o.js.secondCity?
A developer is leading the creation of a new browser application that will serve a single
page application. The team wants to use a new web framework Minimalsit.js.The Lead
developer wants to advocate for a more seasoned web framework that already has a
community around it.
Which two frameworks should the lead developer advocate for?
Choose 2 answers
Given the following code:
document.body.addEventListener(‘ click ’, (event) => {
if (/* CODE REPLACEMENT HERE */) {
console.log(‘button clicked!’);
)
});
Which replacement for the conditional statement on line 02 allows a developer to
correctly determine that a button on page is clicked?
A developer has an is Dog function that takes one argument cat. They want to schedule the function to run every minute.
What is the correct syntax for scheduling this function?
Which three browser specific APIs are available for developers to persist data between page loads ?
Choose 3 answers
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?
A developer has an ErrorHandler module that contains multiple functions.
What kind of export should be leveraged so that multiple functions can be used?
Given the following code:
Counter = 0;
const logCounter = () => {
console.log(counter);
);
logCounter();
setTimeout(logCOunter, 1100);
setInterval(() => {
Counter++
logCounter();
}, 1000);
What is logged by the first four log statements?
Refer to the codebelow:
function foo () {
const a =2;
function bat() {
console.log(a);
}
return bar;
}
Why does the function bar have access to variable a ?
Whichthree actions can be using the JavaScript browser console?
Choose 3 answers:
Given the JavaScript below:
Which code should replace the placeholder comment on line 06 to hide accounts that do not match the search string?
Refer to the HTML below:
Which JavaScript statement results in changing “ The Lion.”?
Refer to code below:
Let productSKU = ‘8675309’ ;
A developer has a requirement to generate SKU numbers that are always 19 characters lon,
starting with ‘sku’, and padded with zeros.
Which statement assigns the values sku0000000008675309 ?
Refer to the code below:
What is the output of this function when called with an empty array?
GIven a value, which three options can a developer use to detect if thevalue is NaN?
Choose 3 answers !
Refer to the code below:
Async funct on functionUnderTest(isOK) {
If (isOK) return ‘OK’;
Throw new Error(‘not OK’);
)
Which assertion accurately tests the above code?
Refer the code below.
x=3.14;
function myfunction() {
"use strict";
y=x;
}
z=x;
myFunction();
Refer to the following code:
Let obj ={
Foo: 1,
Bar: 2
}
Let output =[],
for(let something in obj{
output.push(something);
}
console.log(output);
What is the output line 11?
Refer to the code snippet:
Function getAvailabilityMessage(item) {
If (getAvailability(item)){
Var msg =”Username available”;
}
Return msg;
}
A developer writes this code to return a message to user attempting to register a new
username. If the username is available, variable.
What is the return value of msg hen getAvailabilityMessage (“newUserName” ) is
executed and getAvailability(“newUserName”) returns false?
Refer to code below:
function Person() {
this.firstName = ’John’;
}
Person.prototype ={
Job: x => ‘Developer’
};
const myFather = new Person();
const result=myFather.firstName + ‘ ‘ + myFather.job();
What is the value of the result after line 10 executes?
Given the HTML below:
Which statement adds the priority-account CSS class to the Universal Containers row?
Refer to the code below:
Click me! |