Pre-Summer Sale Special Limited Time 70% Discount Offer - Ends in 0d 00h 00m 00s - Coupon code: xmas50

Salesforce JavaScript-Developer-I - Salesforce Certified JavaScript Developer (JS-Dev-101)

Page: 1 / 5
Total 147 questions

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?

A.

True negative

B.

True positive

C.

False negative

D.

False positive

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?

A.

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

B.

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

C.

Console16bit.prototype.load(gamename) {

D.

Console16bit.prototype.load = function(gamename) {

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?

A.

const addBy = function(num1) {

return function(num2) {

return num1 + num2;

}

}

B.

const addBy = function(num1) {

return num1 * num2;

}

C.

const addBy = (num1) = > num1 + num2;

D.

(Corrected for typing errors)

const addBy = (num1) = > {

return function(num2) {

return num1 + num2;

}

}

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.

An error

B.

NaN

C.

undefined

D.

' London '

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?

A.

Executes server-side JavaScript code to avoid learning a new language.

B.

Performs a static analysis on code before execution to look for runtime errors.

C.

Uses non-blocking functionality for performant request handling.

D.

Ensures stability with one major release every few years.

E.

Installs with its own package manager to install and manage third-party libraries.

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.

console.classy(number + 2 === 0);

B.

assert(number + 2 === 0);

C.

console.assert(number + 2 === 0);

D.

console.error(number + 2 === 0);

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.

import DatePrettyPrint() from ' /path/DatePrettyPrint.js ' ;

printDate();

B.

import DatePrettyPrint from ' /path/DatePrettyPrint.js ' ;

DatePrettyPrint.printDate();

C.

import printDate from ' /path/DatePrettyPrint.js ' ;

DatePrettyPrint.printDate();

D.

import printDate from ' /path/DatePrettyPrint.js ' ;

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?

A.

sum(5)(5);

B.

sum()(10);

C.

sum(5, 5, 0);

D.

sum(10, 0);

E.

sum(5, 2, 3);

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?

A.

[ " bar " , " foo " ]

B.

[1, 2]

C.

[ " foo " , " bar " ]

D.

[ " foo:1 " , " bar:2 " ]

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?

A.

class Vehicle {

constructor(name, price) {

this.name = name;

this.price = price;

}

priceInfo() {

return ' Cost of the ${this.name} is ${this.price}$ ' ;

}

}

B.

class Vehicle {

vehicle(name, price) {

this.name = name;

this.price = price;

}

priceInfo() {

return ' Cost of the ${this.name} is ${this.price}$ ' ;

}

}

C.

class Vehicle {

constructor() {

this.name = name;

this.price = price;

}

priceInfo() {

return `Cost of the ${this.name} is ${this.price}$`;

}

}

D.

class Vehicle {

constructor(name, price) {

this.name = name;

this.price = price;

}

priceInfo() {

return `Cost of the ${this.name} is ${this.price}$`;

}

}