Available in 1, 3, 6 and 12 Months Free Updates Plans
PDF: $15 $60

Test Engine: $20 $80

PDF + Engine: $25 $99

JavaScript-Developer-I Practice Test


Page 10 out of 45 Pages

What is the result of the code block?


A.

The console logs only ‘flag’.


B.

The console logs ‘flag’ and another flag.


C.

An error is thrown.


D.

The console logs ‘flag’ and then an error is thrown.





D.
  

The console logs ‘flag’ and then an error is thrown.



Given the code below:
01 function GameConsole (name) {
02 this.name = name;
03 }
04
05 GameConsole.prototype.load = function(gamename) {
06 console.log( ` $(this.name) is loading a game : $(gamename) …`);
07 )
08 function Console 16 Bit (name) {
09 GameConsole.call(this, name) ;
10 }
11 Console16bit.prototype = Object.create ( GameConsole.prototype) ;
12 //insert code here
13 console.log( ` $(this.name) is loading a cartridge game : $(gamename) …`);
14 }
15 const console16bit = new Console16bit(‘ SNEGeneziz ’);
16 console16bit.load(‘ Super Nonic 3x Force ’);
What should a developer insert at line 15 to output the following message using the
method ?
> SNEGeneziz is loading a cartridge game: Super Monic 3x Force . . .


A.

Console16bit.prototype.load(gamename) = function() {


B.

Console16bit.prototype.load = function(gamename) {


C.

Console16bit = Object.create(GameConsole.prototype).load = function
(gamename) {


D.

Console16bit.prototype.load(gamename) {





B.
  

Console16bit.prototype.load = function(gamename) {



A developer has code that calculates a restaurant bill, but generates incorrect answers
while testing the code:
function calculateBill ( items ) {
let total = 0;
total += findSubTotal(items);
total += addTax(total);
total += addTip(total);
return total;
Which option allows the developer to step into each function execution within calculateBill?


A.

Using the debugger command on line 05.


B.

Using the debugger command on line 03


C.

Calling the console.trace (total) method on line 03.


D.

Wrapping findSubtotal in a console.log() method.





A.
  

Using the debugger command on line 05.



Which three options show valid methods for creating a fat arrow function?
Choose 3 answers


A.

x => ( console.log(‘ executed ’) ; )


B.

[ ] => ( console.log(‘ executed ’) ;)


C.

( ) => ( console.log(‘ executed ’) ;)


D.

X,y,z => ( console.log(‘ executed ’) ;)


E.

(x,y,z) => ( console.log(‘ executed ’) ;)





A.
  

x => ( console.log(‘ executed ’) ; )



E.
  

(x,y,z) => ( console.log(‘ executed ’) ;)



Given the code below:
Function myFunction(){
A =5;
Var b =1;
}
myFunction();
console.log(a);
console.log(b);
What is the expected output?


A.

Both lines 08 and 09 are executed, and the variables are outputted.


B.

Line 08 outputs the variable, but line 09 throws an error.


C.

Line 08 thrones an error, therefore line 09 is never executed.


D.

Both lines 08 and 09 are executed, but values outputted are undefined.





B.
  

Line 08 outputs the variable, but line 09 throws an error.




Page 10 out of 45 Pages
Previous