A developer creates an object where its propertiesshould be immutable and prevent properties from being added or modified. Which method should be used to execute this businessrequirement ?
A. Object.const()
B. Object.eval()
C. Object.lock()
D. Object.freeze()
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 3
B. 1 3 2
C. 2 1 3
D. 2 3 1
Which two options arecore Node.js modules? Choose 2 answers
A. worker
B. isotream
C. exception
D. http
A developer wants to iterate through an array of objects and count the objects and count the objects whose property value, name, starts with the letterN. Const arrObj = [{“name” : “Zach”} , {“name” :“Kate”},{“name” : “Alise”},{“name” : “Bob”},{“name” : “Natham”},{“name” : “nathaniel”} Refer to the code snippet below: 01 arrObj.reduce(( acc, curr) => { 02 //missing line 02 02 //missing line 03 04 ). 0); Which missing lines 02 and 03 return the correctcount?
A. Const sum = curr.startsWith(‘N’) ? 1: 0;Return acc +sum
B. Const sum = curr.name.startsWith(‘N’) ? 1: 0;Return acc +sum
C. Const sum = curr.startsWIth(‘N’) ? 1: 0;Return curr+ sum
D. Const sum =curr.name.startsWIth(‘N’) ? 1: 0;Return curr+ sum
A developer writers the code below to calculate the factorial of a given number. Function factorial(number) { Return number + factorial(number -1); } factorial(3); What is the resultof executing line 04?
A. 0
B. 6
C. -Infinity
D. RuntimeError
Refer to the code:
Given the code above, which three properties are set for pet1? Choose 3 answers
A. name
B. owner
C. type
D. canTalk
E. size
developer creates a new web server that uses Node.js. It imports a server library that uses events and callbacks for handling server functionality. The server library is imported with require and is made available to the code by a variable named server. The developer wants to log any issues that the server has while booting up. Given the code and the information thedeveloper has, which code logs an error at boost with an event?
A. Server.catch ((server) => {console.log(‘ERROR’, error);});
B. Server.error ((server) => {console.log(‘ERROR’, error);});
C. Server.on (‘error’, (error) => {console.log(‘ERROR’, error);});
D. Try{server.start();} catch(error) {console.log(‘ERROR’, error);}
Refer to the code below:
Which replacement for the conditionalstatement on line 02 allows a developer to correctly determine that a specific element, myElement on the page had been clicked?
A. event.target.id =='myElement'
Refer to the code below: letsayHello = () => { 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);
Refer to the following code:
What is the value ofoutput on line 11?
A. [1, 2]
B. [‘’foo’’, ‘’bar’’]
C. [‘’foo’’:1, ‘’bar’’:2’’]
D. An error will occur due to the incorrect usage of the for…of statement on line 07.