How should a developer import every function from the module and then call the functions foo and bar?
developer wants to use a module named universalContainersLib and them callfunctions from it. How should a developer import every function from the module and then call the functions foo and bar?A . import * ad lib from ‘/path/universalContainersLib.js’;lib.foo();lib.bar();B . import (foo, bar) from ‘/path/universalContainersLib.js’;foo();bar();C . import all from ‘/path/universalContaineraLib.js’;universalContainersLib.foo();universalContainersLib.bar();D ....
What is the value of result when Promise.race executes?
catch( arr => ( 10 console.log(“Race is cancelled.”, err); 11 )); What is the value of result when Promise.race executes?A . Car 3 completed the race.B . Car 1 crashed in the race.C . Car 2 completed the race.D . Race is cancelled.View AnswerAnswer: C
What is the value of a?
Given the following code: Let x =(‘15’ + 10)*2; What is the value of a?A . 3020B . 1520C . 50D . 35View AnswerAnswer: A
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
Which statement accurately describes the behaviour of the async/ await keyworks?
Which statement accurately describes the behaviour of the async/ await keyworks?A . The associated class contains some asynchronous functions.B . The associated function will always return a promiseC . The associated function can only be called via asynchronous methodsD . The associated sometimes returns a promise.View AnswerAnswer: D
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 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...
Which code meets this new requirement?
A developer is working on an ecommerce website where the delivery date is dynamically calculated based on the current day. The code line below is responsible for this calculation. Const deliveryDate = new Date (); Due to changes in the business requirements, the delivery date must now be today’s date...
.finally(() =>console.log(" when am I called?
Referto 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 resolved and...
In which situation should a developer include a try .. catch block around their function call?
In which situation should a developer include a try .. catch block around their function call?A . The function has an error that should not be silenced.B . The function results in an out of memory issue.C . The function might raise a runtime error that needs to be handled.D...
Which statement should be used to call personalizeWebsiteContent based on the above business requirement?
A developer at Universal Containers creates a new landing page based on HTML, CSS, and JavaScript TO ensure that visitors have a good experience, a script named personaliseContext needs to be executed when the webpage is fully loaded (HTML content and all related files), in order to do some custom...