Which two results occur when running the 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 number in the array, The test passes: Let res = sum2([1, 2, 3 ]) ; console.assert(res === 6 ); Res = sum3([ 1, 2,...

January 19, 2021 No Comments READ MORE +

How should a developer import every function from the module and then call the fuctions foo and bar?

developer wants to use a module named universalContainersLib and them call functions from it. How should a developer import every function from the module and then call the fuctions 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 ....

January 19, 2021 No Comments READ MORE +

Which replacement for the conditional statement on line 02 allows a developer to correctly determine that a button on page is clicked?

Given the following code: document.body.addEventListener(‘ click ’, (event) => { if (/* CODE REPLACEMENT HERE */) { console.log(‘button clicked!’); ) }); Which replacement for the conditional statement on line 02 allows a developer to correctly determine that a button on page is clicked?A . Event.clickedB . e.nodeTarget ==thisC . event.target.nodeName...

January 19, 2021 No Comments READ MORE +

Which line of code properly declares the clothingItem class such that it inherits from Item?

Cloud Kicks has a class to represent items for sale in an online store, as shown below: Class Item{ constructor (name, price){ this.name = name; this.price = price; } formattedPrice(){ return ‘s’ + String(this.price);}} A new business requirement comes in that requests a ClothingItem class that should have all of...

January 18, 2021 No Comments READ MORE +

What is the result of executing line 04?

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 result of executing line 04?A . 0B . 6C . -InfinityD . RuntimeErrorView AnswerAnswer: D

January 18, 2021 No Comments READ MORE +

Which javascript methods can be used to serialize an object into a string and deserialize a JSON string into an object, respectively?

Which javascript methods can be used to serialize an object into a string and deserialize a JSON string into an object, respectively?A . JSOB . stringify and JSOC . parseD . JSOE . serialize and JSOF . deserializeG . JSOH . encode and JSO . decode . JSO . parse...

January 16, 2021 No Comments READ MORE +

Which two promises are rejected?

A developer is wondering whether to use, Promise.then or Promise.catch, especially when a Promise throws an error? Which two promises are rejected? Which 2 are correct?A . Promise.reject(‘cool error here’).then(error => console.error(error));B . Promise.reject(‘cool error here’).catch(error => console.error(error));C . New Promise((resolve, reject) => (throw ‘cool error here’}).catch(error => console.error(error)) ;D...

January 16, 2021 No Comments READ MORE +

After running this code, which result is displayed on the console?

Refer to the code below: Const searchTest = ‘Yay! Salesforce is amazing!” ; Let result1 = searchText.search(/sales/i); Let result 21 = searchText.search(/sales/i); console.log(result1); console.log(result2); After running this code, which result is displayed on the console?A . > true > falseB . > 5 >undefinedC . > 5 > -1D ....

January 16, 2021 1 Comment READ MORE +

What should a developer insert at line 15 to output the following message using the method?

Given the code below: 01 function GameConsole (name) { 02 this.name = name; 3 } 4 5 GameConsole.prototype.load = function(gamename) { 6 console.log( ` $(this.name) is loading a game : $(gamename) …`); 7 ) 8 function Console 16 Bit (name) { 9 GameConsole.call(this, name) ; 10 } 11 Console16bit.prototype =...

January 16, 2021 No Comments READ MORE +

What is the value of copy?

Given the code below: const copy = JSON.stringify([ new String(‘ false ’), new Bollean( false ), undefined ]); What is the value of copy?A . -- [ ”false” , { } ]--B . -- [ false, { } ]--C . -- [ ”false” , false, undefined ]--D . -- [...

January 16, 2021 1 Comment READ MORE +