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 2completed''));04 let car3 = new Promise(resolve => setTimeout (resolve, 3000, ''Car 3Completed''));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: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: $(result1) $(result2)$(result3)`;08 }}}Which two statements correctly execute the runParallel () function?Choose 2 answers
Refer to the code snippet below:Let array = [1, 2, 3, 4, 4, 5, 4, 4];For (let i =0; i < array.length; i++){if (array[i] === 4) {array.splice(i, 1);}}What is the value of the array after the code executes?
A developer has the function, shown below, that is called when a page loads.function onload() {console.log(''Page has loaded!'');}Where can the developer see the log statement after loading the page in the browser?
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?