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...

February 21, 2022 No Comments READ MORE +

Consider type coercion, what does the following expression evaluate to?

Consider type coercion, what does the following expression evaluate to? True + 3 + ‘100’ + nullA . 104B . 4100C . ‘3100null’D . ‘4100null’View AnswerAnswer: D

February 21, 2022 No Comments READ MORE +

Which statement assigns the values sku 0000000008675309?

Refer to code below: Let productSKU = ‘8675309’ ; A developer has a requirement to generate SKU numbers that are always 19 characters lon, starting with ‘sku’, and padded with zeros. Which statement assigns the values sku 0000000008675309?A . productSKU = productSKB . padStart (19. ‘0’).padstart(‘sku’);C . productSKU = productSKD...

February 20, 2022 No Comments READ MORE +

Which assertion accuretely tests the above code?

Refer to the code below: Async funct on functionUnderTest(isOK) { If (isOK) return ‘OK’ ; Throw new Error(‘not OK’); ) Which assertion accuretely tests the above code?A . Console.assert (await functionUnderTest(true), ‘ OK ’)B . Console.assert (await functionUnderTest(true), ‘ not OK ’)C . Console.assert (await functionUnderTest(true), ‘ not OK ’)D...

February 19, 2022 No Comments READ MORE +

Which statement flattens myArray when it can be arbitrarily nested?

myArraym can have one level, two levels, or more levels. Which statement flattens myArray when it can be arbitrarily nested?A . myArray. reduce ((prev, curr) => prev.concat(curr) [ ]);B . myArray. join (","). split (",");C . [ ] .concat {. . .myArray) ;D . myArray.flat(Infinity);View AnswerAnswer: A

February 19, 2022 2 Comments READ MORE +

What is the value of the array after the code executes?

Refer to the code snippet below: Let array = [1, 2, 3, 4, 4, 5, 4, 4]; For (let i =0; i < array.length; i++){ if (array[i] === 4) { array.splice(i, 1); } } What is the value of the array after the code executes?A . [1, 2, 3, 4,...

February 19, 2022 No Comments READ MORE +

In lines 04 and 08, which code allows the user to select an image from their local computer, and to display the image in the browser?

is below: <input type=”file” onchange=”previewFile()”> <img src=”” height=”200” alt=”Image Preview…”/> The JavaScript portion is: 01 function previewFile(){ 02 const preview = document.querySelector(‘img’); 03 const file = document.querySelector(‘input[type=file]’).files[0]; 04 //line 4 code 05 reader.addEventListener(“load”, () => { 06 preview.src = reader.result; 07 },false); 08 //line 8 code 09 } In lines...

February 18, 2022 No Comments READ MORE +

Which two statement result in the word 'Sale'?

Refer of the string below: Const str = ‘sa;esforce’=; Which two statement result in the word 'Sale'? Choose 2 answersA . str, substring (0,5) ;B . str, substr(0,5) ;C . str, substring(1,5) ;D . str, substr(1,5) ;View AnswerAnswer: A,B

February 18, 2022 No Comments READ MORE +

Which two statements could be inserted at line 17 to enable the function call on line 18?

Refer to the following code: 01 function Tiger(){ 02 this.Type = ‘Cat’; 03 this.size = ‘large’; 4 } 5 06 let tony = new Tiger(); 07 tony.roar = () =>{ 08 console.log(‘They’re great1’); 9 }; 10 11 function Lion(){ 12 this.type = ‘Cat’; 13 this.size = ‘large’; 14 } 15...

February 18, 2022 No Comments READ MORE +

What are three key steps to implement this debounce function?

Universal Containers (UC) notices that its application that allows users to search for accounts makes a network request each time a key is pressed. This results in too many requests for the server to handle. Address this problem, UC decides to implement a debounce function on string change handler. What...

February 18, 2022 1 Comment READ MORE +