Certbus > Salesforce > Salesforce Developer > JAVASCRIPT-DEVELOPER-I > JAVASCRIPT-DEVELOPER-I Online Practice Questions and Answers

JAVASCRIPT-DEVELOPER-I Online Practice Questions and Answers

Questions 4

A developer is leading the creation of a new web server for their team that will fulfill API requests from an existing client.

The team wants a web server that runs on Node.Js, and they want to use the new web framework Minimalist.Js. The lead developer wants to advocate for a more seasoned back- end framework that already has a community around it.

Which two frameworks could the lead developer advocate for?

Choose 2 answers

A. Gatsby

B. Angular

C. Express

D. Koa

Browse 223 Q&As
Questions 5

Referto the code below: Const pi = 3.1415326, What is the data type of pi?

A. Double

B. Number

C. Decimal

D. Float

Browse 223 Q&As
Questions 6

Given code below:

setTimeout (() => (

console.log(1);

). 0);

console.log(2);

New Promise ((resolve, reject )) = > (

setTimeout(() => (

reject(console.log(3));

). 1000);

)).catch(() => (

console.log(4);

));

console.log(5);

What is logged to the console?

A. 2 1 4 3 5

B. 2 5 13 4

C. 1 2 4 3 5

D. 1 2 5 3 4

Browse 223 Q&As
Questions 7

Given the HTML below:

Which statement adds the priority-account CSS class to the Universal Containers row?

A. document. querySelector (#row-uc').classes-push('priority-account');

B. document. getElementByid('row-uc').addClass('priority-account*);

C. document. querySelectorAll('#row-uc') -classList.add("priority-accour');

D. document. queryselector('#row-uc').ClassList.add('priority-account');

Browse 223 Q&As
Questions 8

Refer to the expression below:

Let x =(`1' + 2) == (6 * 2);

How should this expression be modified to ensure that evaluates to false?

A. Let x = (`1' + ` 2') == ( 6 * 2);

B. Let x = (`1' + 2) == ( 6 * 2);

C. Let x = (1 + 2) == ( `6' / 2);

D. Let x = (1 + 2 ) == ( 6 / 2);

Browse 223 Q&As
Questions 9

Refer to following code block:

Let array = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11,];

Let output =0;

For (let num of array){

if (output >0){

Break;

}

if(num % 2 == 0){

Continue;

}

Output +=num;

What is the value of output after the code executes?

A. 16

B. 36

C. 11

D. 25

Browse 223 Q&As
Questions 10

Given the code below:

01 function GameConsole (name) {

02 this.name = name;

03 }

05 GameConsole.prototype.load = function(gamename) {

06 console.log( ` $(this.name) is loading agame : $(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 cartridgegame: 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) {

Browse 223 Q&As
Questions 11

Which statement accurately describes an aspect of promises?

A. Arguments for the callback function passed to .then() are optional.

B. In a.then()function, returning results is not necessary since callbacks will catch the result of a previous promise.

C. .then() cannot be added after a catch.

D. .then() manipulates and returns the original promise.

Browse 223 Q&As
Questions 12

Refer to the code below:

new Promise((resolve, reject) => {

const fraction = Math.random();

if( fraction >0.5) reject("fraction > 0.5, " + fraction);

resolve(fraction);

})

.then(() =>console.log("resolved"))

.catch((error) => console.error(error))

.finally(() => console.log(" when am I called?"));

When does Promise.finally on line 08 get called?

A. When rejected

B. When resolved and settled

C. When resolved

D. When resolved or rejected

Browse 223 Q&As
Questions 13

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 commandon 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.

Browse 223 Q&As
Questions 14

GIven a value, which three options can a developer use to detect if the value is NaN? Choose 3 answers !

A. value == NaN

B. Object.is(value, NaN)

C. value === Number.NaN

D. value ! == value

E. Number.isNaN(value)

Browse 223 Q&As
Questions 15

A developer writes the code below to return a message to a user attempting to register a new username. If the username is available, a variable named nag is declared and assigned a value on line 03.

What is the value of msg when getAvailableabilityMessage ("newUserName") is executed and get Availability ("newUserName") returns true?

A. "msg is not defined"

B. "newUserName"

C. "User-name available"

D. undefined

Browse 223 Q&As
Questions 16

Cloud Kicks has a class to represent items for sale in an online store, as shown below:

Class Item{

constructor (name, price){

this.name = name;

this.price = price;

}

formattedPrice(){

return `s' + String(this.price);}}

A new business requirement comes in that requests a ClothingItem class that should have all of the properties and methods of the Item class but will also have properties that are specific to clothes.

Which line of code properly declares the clothingItem class such that it inherits from Item?

A. Class ClothingItem implements Item{

B. Class ClothingItem {

C. Class ClothingItem super Item {

D. Class ClothingItem extends Item {

Browse 223 Q&As
Questions 17

Given the code below:

Which method can be used to provide a visual representation of the list of users and to allow sorting by the name or email attribute?

A. console.group(usersList) ;

B. console.table(usersList) ;

C. console.info(usersList) ;

D. console.groupCol lapsed(usersList) ;

Browse 223 Q&As
Questions 18

A developer wants to use a module called DataPrettyPrint. This module exports one default function called printDate (). How can a developer import and use the printDate() function?

A. Option A

B. Option B

C. Option C

D. Option D

Browse 223 Q&As
Exam Name: Salesforce Certified JavaScript Developer I
Last Update: Apr 23, 2024
Questions: 223 Q&As

PDF

$45.99

VCE

$49.99

PDF + VCE

$59.99