Which three statements are true about promises? Choose 3 answers
Which three statements are true about promises? Choose 3 answersA . The executor of a new Promise runs automatically.B . A Promise has a .then() method.C . A fulfilled or rejected promise will not change states .D . A settled promise can become resolved.E . A pending promise can become...
Which version of bar .awesome is installed?
bar, awesome is a popular JavaScript module. the versions publish to npm are: Teams at Universal Containers use this module in a number of projects. A particular project has the package, json definition below. A developer runs this command: npm install. Which version of bar .awesome is installed?A . 1.3.1B...
Which two test approaches describe the requirement?
A test has a dependency on database.query. During the test the dependency is replaced with an object called database with the method, query, that returns an array. The developer needs to verify how many times the method was called and the arguments used each time. Which two test approaches describe...
Refer to the code below:
Refer to the code below: Let str = ‘javascript’; Str[0] = ‘J’; Str[4] = ’S’; After changing the string index values, the value of str is ‘javascript’ . What is the reason for this value:A . Non-primitive values are mutable.B . Non-primitive values are immutable.C . Primitive values are mutable.D...
What is the data type of pi?
Refer to the code below: Const pi = 3.1415326, What is the data type of pi?A . DoubleB . NumberC . DecimalD . FloatView AnswerAnswer: B
Which two results occur when running this test on the updated sum3 function?
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...
What is returned by the function call on line 13?
Refer to the following code: function test (val) { If (val === undefined) { return ‘Undefined values!’ ; } if (val === null) { return ‘Null value! ’; } return val; } Let x; test(x); What is returned by the function call on line 13?A . UndefinedB . Line 13...
Which command can the web developer run to see what the module is doing during the latency period?
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 turn around for web requests, the developer now sees a five second turnaround, Which command can the web developer run...
What can the developer do to change the code to print “Hello World”?
The developer has a function that prints “Hello” to an input name. To test this, the developer created a function that returns “World”. However the following snippet does not print “Hello World”. What can the developer do to change the code to print “Hello World”?A . Change line 7 to...
.finally(() => console.log(" when am I called?
Refer to the code below: new Promise((resolve, reject) => { const fraction = Math.random(); if( fraction >0.5) reject("fraction > 0.5, " + fraction); resolve(fraction); }) .then(() =>console.log("resolved")) .catch((error) => console.error(error)) .finally(() => console.log(" when am I called?")); When does Promise.finally on line 08 get called?A . When rejectedB . When...