What is the console output?
Refer to the following code block: What is the console output?A . > Better student Jackie got 70% on test. B. > Jackie got 70% on test. C. > Uncaught Reference Error D. > Better student Jackie got 100% on test.View AnswerAnswer: D
Which global variable can be used in the script?
A developer is setting up a Node,js server and is creating a script at the root of the source code, index,js, that will start the server when executed. The developer declares a variable that needs the folder location that the code executes from. Which global variable can be used in...
Which two lines of code result in a second array, arr2 being created such that arr2 is not a reference to arr1?
Refer to the following array: Let arr1 = [ 1, 2, 3, 4, 5 ]; Which two lines of code result in a second array, arr2 being created such that arr2 is not a reference to arr1?A . Let arr2 = arr1.slice(0, 5); B. Let arr2 = Array.from(arr1); C. Let...
what is the result of executing the code?
A developer writes the code below to calculate the factorial of a given number function sum(number) { return number * sum(number-1); } sum (3); what is the result of executing the code?A . 0 B. 6 C. Error D. -InfinityView AnswerAnswer: C
Why does the function bar have access to variable a?
Refer to the code below: function foo () { const a =2; function bat() { console.log(a); } return bar; } Why does the function bar have access to variable a?A . Inner function’s scope B. Hoisting C. Outer function’s scope D. Prototype chainView AnswerAnswer: C
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 ) 08 function Console 16 Bit (name) { 09 GameConsole.call(this, name) ; 10 } 11 Console16bit.prototype =...
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.clicked B. e.nodeTarget ==this C. event.target.nodeName...
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,...
Which two reasons could be possible explanations for this?
A team that works on a big project uses npm to deal with projects dependencies. A developer added a dependency does not get downloaded when they execute npm install. Which two reasons could be possible explanations for this? Choose 2 answersA . The developer missed the option --add when adding...
Which statement can a developer apply to increment the browser's navigation history without a page refresh?
Which statement can a developer apply to increment the browser's navigation history without a page refresh? Which statement can a developer apply to increment the browser's navigation history without a page refresh?A . window.history.pushState(newStateObject); B. window.history.pushStare(newStateObject, '', null); C. window.history.replaceState(newStateObject,'', null); D. window.history.state.push(newStateObject);View AnswerAnswer: C