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 ?
A developer initiates a server with the file server,js and adds dependencies in the source codes package,json that are required to run the server.
Which command should the developer run to start the server locally?
A developer wrote the following code to test a sum3 function that takes in an array of numbers and returns the sum of the first three numbers in the array, and the test passes.
A different developer made changes to the behavior of sum3 to instead sum only the first two numbers present in the array.
Which two results occur when running this test on the updated sum3 function?
Choose 2 answers
Refer to the code below:
Which value can a developer expect when referencing country,capital,cityString?
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?
Refer to the code below:
What is the value of result when the code executes?
Which statement phrases successfully?
Considering the implications of 'use strict' on line 04, which three statements describe the execution of the code?
Choose 3 answers
developer publishes a new version of a package with new features that do not break
backward compatibility. The previous version number was 1.1.3.
Following semantic versioning format, what should the new package version number
be?
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?