Salesforce JavaScript-Developer-I - Salesforce Certified JavaScript Developer (JS-Dev-101)
A developer removes the HTML class attribute from the checkout button, so now it is simply:
< button > Checkout < /button >
There is a test to verify the existence of the checkout button, however it looks for a button with class= " blue " . The test fails because no such button is found.
Which type of test category describes this test?
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?
Refer to the code below:
01 const addBy = ?
02 const addByEight = addBy(8);
03 const sum = addByEight(50);
Which two functions can replace line 01 and return 58 to sum?
Refer to the code below:
01 let country = {
02 get capital() {
03 let city = Number( " London " );
04
05 return {
06 cityString: city.toString(),
07 }
08 }
09 }
Which value can a developer expect when referencing country.capital.cityString?
A developer is trying to convince management that their team will benefit from using Node.js for a backend server that they are going to create. The server will be a web server that handles API requests from a website that the team has already built using HTML, CSS, and JavaScript.
Which three benefits of Node.js can the developer use to persuade their manager?
for (let number = 2; number < = 5; number += 1) {
// faster code statement here
}
Which statement meets the requirements to log an error when the Boolean statement evaluates to false?
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()?
A developer implements a function that adds a few values.
function sum(num1, num2, num3) {
if (num3 === undefined) {
num3 = 0;
}
return num1 + num2 + num3;
}
Which three options can the developer invoke for this function to get a return value of 10?
Corrected code:
let obj = {
foo: 1,
bar: 2
};
let output = [];
for (let something in obj) {
output.push(something);
}
console.log(output);
What is the output of line 11?
Original constructor function:
01 function Vehicle(name, price) {
02 this.name = name;
03 this.price = price;
04 }
05 Vehicle.prototype.priceInfo = function () {
06 return `Cost of the $(this.name) is $(this.price)$`;
07 }
08 var ford = new Vehicle( ' Ford Fiesta ' , ' 20,000 ' );
Which class definition is correct?
