Summer Special 60% Discount Offer - Ends in 0d 00h 00m 00s - Coupon code: bestdeal

Free Salesforce JavaScript-Developer-I Practice Exam with Questions & Answers

Questions 1

Refer to code below:

Let a =’a’;

Let b;

// b = a;

console.log(b);

What is displayed when the code executes?

Options:
A.

ReferenceError: b is not defined

B.

A

C.

Undefined

D.

Null

Questions 2

Refer to code below:

Function muFunction(reassign){

Let x = 1;

var y = 1;

if( reassign ) {

Let x= 2;

Var y = 2;

console.log(x);

console.log(y);}

console.log(x);

console.log(y);}

What is displayed when myFunction(true) is called?

Options:
A.

2 2 1 1

B.

2 2 undefined undefined

C.

2 2 1 2

D.

2 2 2 2

Questions 3

A developer wants to iterate through an array of objects and count the objects and count

the objects whose property value, name, starts with the letterN.

Const arrObj = [{“name” : “Zach”} , {“name” :“Kate”},{“name” : “Alise”},{“name” : “Bob”},{“name” :

“Natham”},{“name” : “nathaniel”}

Refer to the code snippet below:

01 arrObj.reduce(( acc, curr) => {

02 //missing line 02

02 //missing line 03

04 ). 0);

Which missing lines 02 and 03 return the correctcount?

Options:
A.

Const sum = curr.startsWith(‘N’) ? 1: 0;Return acc +sum

B.

Const sum = curr.name.startsWith(‘N’) ? 1: 0;Return acc +sum

C.

Const sum = curr.startsWIth(‘N’) ? 1: 0;Return curr+ sum

D.

Const sum =curr.name.startsWIth(‘N’) ? 1: 0;Return curr+ sum

Questions 4

Refer to the code below:

let o = {

get js() {

let city1 = String("st. Louis");

let city2 = String(" New York");

return {

firstCity: city1.toLowerCase(),

secondCity: city2.toLowerCase(),

}

}

}

What value can a developer expect when referencing o.js.secondCity?

Options:
A.

Undefined

B.

‘ new york ’

C.

‘ New York ’

D.

An error

Questions 5

Given the code below:

01 function GameConsole (name) {

02 this.name = name;

03 }

04

05GameConsole.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 . . .

Options:
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) {

Questions 6

Given the following code:

JavaScript-Developer-I Question 6

is the output ofline 02?

Options:
A.

''x''

B.

''null'''

C.

''object''

D.

''undefined''

Questions 7

Refer to the code declarations below:

JavaScript-Developer-I Question 7

Whichthree expressions return the string JavaScript?

Choose 3 answers

Options:
A.

Str1.join (str2);

B.

Str1.concat (str2);

C.

Concat (str1, str2);

D.

$(str1) $ (str2} ‘;

E.

Str1 + str2;

Questions 8

Refer to the code below:

Const searchTest = ‘Yay! Salesforce is amazing!” ;

Let result1 = searchText.search(/sales/i);

Let result 21 = searchText.search(/sales/i);

console.log(result1);

console.log(result2);

After running this code, which result is displayed on the console?

Options:
A.

> true > false B. > 5>undefined

B.

> 5 > -1

C.

> 5 > 0

Questions 9

Refer to HTML below:

The current status of an Order: In Progress

.

Which JavaScript statement changes thetext ‘In Progress’ to ‘Completed’ ?

Options:
A.

document.getElementById(“status”).Value = ’Completed’ ;

B.

document.getElementById(“#status”).innerHTML = ’Completed’ ;

C.

document.getElementById(“status”).innerHTML = ’Completed’ ;

D.

document.getElementById(“.status”).innerHTML = ’Completed’ ;

Questions 10

Given the JavaScript below:

JavaScript-Developer-I Question 10

Which code should replace the placeholder comment on line 05 to highlight accounts that match the search string'

Options:
A.

'yellow' : null

B.

null : 'yellow’

C.

'none1 : "yellow’

D.

'yellow : 'none'