Which two statements result in the array [1, 2, 3, 4, 5]?
Refer to the code below: Let inArray =[ [ 1, 2 ] , [ 3, 4, 5 ] ]; Which two statements result in the array [1, 2, 3, 4, 5]? Choose 2 answersA . [ ]. Concat.apply ([ ], inArray);B . [ ]. Concat (... inArray);C . [ ]....
What is logged to the console?
Given code below: setTimeout (() => ( console.log(1); ). 0); console.log(2); New Promise ((resolve, reject )) = > ( setTimeout(() => ( reject(console.log(3)); ). 1000); )).catch(() => ( console.log(4); )); console.log(5); What is logged to the console?A . 2 1 4 3 5B . 2 5 1 3 4C ....
What is displayed when the code executes?
Refer to code below: Let a =’a’; Let b; // b = a; console.log(b); What is displayed when the code executes?A . Reference Error: b is not definedB . AC . UndefinedD . NullView AnswerAnswer: C
Which missing lines 02 and 03 return the correct count?
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 letter N. Const arrObj = [{“name” : “Zach”} , {“name” : “Kate”},{“name” : “Alise”},{“name” : “Bob”},{“name” : “Natham”},{“name” : “nathaniel”} Refer to the code snippet...
Which two methods are used to address this?
In the browser, the window object is often used to assign variables that require the broadest scope in an application Node.js application does not have access to the window object by default. Which two methods are used to address this? Choose 2 answersA . Use the document object instead of...
Which command can the web developer run to see what the module is doing during the latency period?
A developer has a web server running with Node.js. The command to start the web server is node server.js. The web server started having latency issues. Instead of a one second turnaround for web requests, the developer now sees a five second turnaround. Which command can the web developer run...
What is the correct syntax to schedule this function?
A developer has a formatName function that takes two arguments, firstName and lastName and returns a string. They want to schedule the function to run once after five seconds. What is the correct syntax to schedule this function?A . setTimeout (formatName(), 5000, "John", "BDoe");B . setTimeout (formatName('John', ‘'Doe'), 5000);C ....
Which two assert statements are valid tests for the function?
A developer needs to test this function: 01 const sum3 = (arr) => ( 02 if (!arr.length) return 0, 03 if (arr.length === 1) return arr[0], 04 if (arr.length === 2) return arr[0] + arr[1], 05 return arr[0] + arr[1] + arr[2], 06 ); Which two assert statements are valid...
Which two options can correctly replace line 01 and declare the function for use?
A developer wants to define a function log to be used a few times on a single-file JavaScript script. 01 // Line 1 replacement 02 console.log('"LOG:', logInput); 03 } Which two options can correctly replace line 01 and declare the function for use? Choose 2 answersA . function leg(logInput) {B...
Which code assignment shows a correct way to convert this string to an integer?
Refer to the code below: Let textValue = ’1984’; Which code assignment shows a correct way to convert this string to an integer?A . let numberValue = Number(textValue);B . Let numberValue = (Number)textValue;C . Let numberValue = textValue.toInteger();D . Let numberValue = Integer(textValue);View AnswerAnswer: A