How should thedeveloper implement the request?
A developer has the following array of student test grades: Let arr = [ 7, 8, 5, 8, 9]; The Teacher wants to double each score and then see an array of the students who scored more than 15 points. How should thedeveloper implement the request?A . Let arr1 =...
Which two implementations of Utils.js export foo and bar such that the code above runs without error?
Refer to the following code that imports a module named utils: import (foo, bar) from ‘/path/Utils.js’; foo() ; bar() ; Which two implementations of Utils.js export foo and bar such that the code above runs without error? Choose 2 answersA . // FooUtils.js and BarUtils.js exist Import (foo) from ‘/path/FooUtils.js’;...
Which code statement correctly retrieves and returns an object from localStorage?
Which code statement correctly retrieves and returns an object from localStorage?A . const retrieveFromLocalStorage = () =>{return JSON.stringify(window.localStorage.getItem(storageKey));}B . const retrieveFromLocalStorage = (storageKey) =>{return window.localStorage.getItem(storageKey);}C . const retrieveFromLocalStorage = (storageKey) =>{return JSON.parse(window.localStorage.getItem(storageKey));}D . constretrieveFromLocalStorage = (storageKey) =>{return window.localStorage[storageKey];}View AnswerAnswer: C
Which two statements correctly execute the runParallel () function?
Refer to the code below: 01 const exec = (item, delay) =>{ 02 newPromise(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 ); 7 return `parallel is done: $(result1)$(result2)$(result3)`; 8...
What is the output line 11?
Refer to the following code: Let obj ={ Foo: 1, Bar: 2 } Let output =[], for(let something in obj{ output.push(something); } console.log(output); What is the output line 11?A . [1,2]B . [“bar”,”foo”]C . [“foo”,”bar”]D . [“foo:1”,”bar:2”]View AnswerAnswer: C
How many growl methods are created with Option A Option B?
A developer has two ways to write a function: Option A: function Monster() { This.growl = () => { Console.log (“Grr!”); } } Option B: function Monster() {}; Monster.prototype.growl =() => { console.log(“Grr!”); } After deciding on an option, the developer creates 1000 monster objects. How many growl methods are...
Which two statements results in the word 'Sales'?
CORRECT TEXT Refer to the string below. Const str=’Salesforce’; Which two statements results in the word 'Sales'?View AnswerAnswer: Str.substring(0,5); Str.substr(0,5);
What will be the first four numbers logged?
Given the following code: What will be the first four numbers logged?A . 0012 B. 0112 C. 0122 D. 0123View AnswerAnswer: B
What happens due to lack of the new keyword on line 02?
A developer wants to create an object from a function in the browser using the code below: Function Monster() { this.name = ‘hello’ }; Const z = Monster(); What happens due to lack of the new keyword on line 02?A . The z variable is assigned the correct object. B....
How should a developer import every function from the module and then call the functions foo and bar?
A developer wants to use a module named universalContainersLib and then call functions from it. How should a developer import every function from the module and then call the functions foo and bar?A . import * from '/path/universalContainersLib.js'; universalContainersLib. foo ()7 universalContainersLib.bar (); B. import {foo,bar} from '/path/universalCcontainersLib.js'; foo(): bar()?...