Given two expressions var1 and var2, what are two valid ways to return the concatenation of the two expressions and ensure it is data type string?
A developer publishes a new version of a package with bug fixes but no breaking changes. The old version number was 2.1.1.
What should the new package version number be based on semantic versioning?
A developer wants to use a module called DatePrettyPrint.
This module exports one default function called printDate().
How can the developer import and use printDate()?
Given the code below:
01 const delay = async delay = > {
02 return new Promise((resolve, reject) = > {
03 console.log(1);
04 setTimeout(resolve, delay);
05 });
06 };
07
08 const callDelay = async () = > {
09 console.log(2);
10 const yup = await delay(1000);
11 console.log(3);
12 };
13
14 console.log(4);
15 callDelay();
16 console.log(5);
What is logged to the console?
Refer to the HTML below:
< div id= " main " >
< ul >
< li > Leo < /li >
< li > Tony < /li >
< li > Tiger < /li >
< /ul >
< /div >
Which JavaScript statement results in changing " Leo " to " The Lion " ?
Given the code below:
let numValue = 1982;
Which three code segments result in a correct conversion from number to string?
Refer to the following object:
const dog = {
firstName: ' Beau ' ,
lastName: ' Boo ' ,
get fullName() {
return this.firstName + ' ' + this.lastName;
}
};
How can a developer access the fullName property for dog?
A class was written to represent regular items and sale items. Code:
01 let regItem = new Item( ' Scarf ' , 55);
02 let saleItem = new SaleItem( ' Shirt ' , 80, .1);
03 Item.prototype.description = function() { return ' This is a ' + this.name; }
04 console.log(regItem.description());
05 console.log(saleItem.description());
06
07 SaleItem.prototype.description = function() { return ' This is a discounted ' + this.name; }
08 console.log(regItem.description());
09 console.log(saleItem.description());
What is the output?
Given the following code:
01 counter = 0;
02 const logCounter = () = > {
03 console.log(counter);
04 };
05 logCounter();
06 setTimeout(logCounter, 2100);
07 setInterval(() = > {
08 counter++;
09 logCounter();
10 }, 1000);
What will be the first four numbers logged?
Given the code:
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
09 function Console16bit(name) {
10 GameConsole.call(this, name);
11 }
12
13 Console16bit.prototype = Object.create(GameConsole.prototype);
14
15 // insert code here
16 console.log( ' ${this.name} is loading a cartridge game: ${gamename}.... ' );
17 }
18
19 const console16bit = new Console16bit( ' SNEGeneziz ' );
20 console16bit.load( ' Super Monic 3x Force ' );
What should a developer insert at line 15?