What are two valid ways to return the logical AND of the two expressions and ensure it is data type Boolean?
Given two expressions var1 and var2 . What are two valid ways to return the logical AND of the two expressions and ensure it is data type Boolean? Choose 2 answers:A . Boolean(var1 && var2)B . var1 && var2C . var1.toBoolean() && var2toBoolean()D . Boolean(var1) && Boolean(var2)View AnswerAnswer: A,D
Which two statements correctly execute the runParallel () function?
Refer to the code below: 01 const exec = (item, delay) =>{ 02 new Promise(resolve => setTimeout( () => resolve(item), delay)), 03 async function runParallel() { 04 Const (result1, result2, result3) = await Promise.all{ 05 [exec (‘x’, ‘100’) , exec(‘y’, 500), exec(‘z’, ‘100’)] 06 ); 07 return `parallel is done:...
What is logged to the console?
Given the code below: const delay = sync delay => { Return new Promise((resolve, reject) => { setTimeout (resolve, delay);});}; const callDelay =async () =>{ const yup =await delay(1000); console.log(1); What is logged to the console?A . 1 2 3B . 1 3 2C . 2 1 3D . 2...
Which two options remove the whitespace from the beginning of searchString?
Refer to the code below? Let searchString = ‘ look for this ’; Which two options remove the whitespace from the beginning of searchString? Choose 2 answersA . searchString.trimEnd();B . searchString.trimStart();C . trimStart(searchString);D . searchString.replace(/*ss*/, ‘’);View AnswerAnswer: B,D
What is the output after the code executes successfully?
Refer to the code below: console.log(‘’start); Promise.resolve(‘Success’) .then(function(value){ console.log(‘Success’); }); console.log(‘End’); What is the output after the code executes successfully?A . End Start SuccessB . Start Success EndC . Start End SuccessD . Success Start EndView AnswerAnswer: C
Which value can a developer expect when referencing country,capital,city String?
Refer to the code below: Which value can a developer expect when referencing country,capital,city String?A . 'London'B . undefinedC . An errorD . 'NaN'View AnswerAnswer: D
Which code executes sayHello once, two minutes from now?
Refer to the code below: let sayHello = () => { console.log (‘Hello, world!’); }; Which code executes sayHello once, two minutes from now?A . setTimeout(sayHello, 12000);B . setInterval(sayHello, 12000);C . setTimeout(sayHello(), 12000);D . delay(sayHello, 12000);View AnswerAnswer: A
Which three benefits of Node.js can the developer use to persuade their manager?
developer is trying to convince management that their team will benefit from using Node.js for a backend server that they are going to create. The server will be a web server that handles API requests from a website that the team has already built using HTML, CSS, and JavaScript. Which...
Which replacement for the conditional statement on line 02 allows a developer to correctly determine that a button on page is clicked?
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 . Event.clickedB . e.nodeTarget ==thisC . event.target.nodeName...
What is the value of result when Promise.race executes?
Refer to the code below: Let car1 = new Promise((_ , reject) => setTimeout(reject, 2000, “car 1 crashed in” => Let car2 =new Promise(resolve => setTimeout(resolve, 1500, “car 2 completed”) Let car3 =new Promise(resolve => setTimeout(resolve, 3000, “car 3 completed”) Promise.race(( car1, car2, car3)) .then (value => ( Let result...