Weekend Special Limited Time 70% Discount Offer - Ends in 0d 00h 00m 00s - Coupon code: simple70

Pass the Salesforce Developer JavaScript-Developer-I Questions and answers with ValidTests

Exam JavaScript-Developer-I All Questions
Exam JavaScript-Developer-I Premium Access

View all detail and faqs for the JavaScript-Developer-I exam

Viewing page 1 out of 7 pages
Viewing questions 1-10 out of questions
Questions # 1:

Question # 1

Which code change should be done for the console to log the following when 'Click me!' is clicked'

> Row log

> Table log

Options:

A.

Remove lines 13 and14

B.

Change line 10 to event.stopPropagation (false) ;

C.

Change line 14 toelem.addEventListener ('click', printMessage, true);

D.

Remove line 10

Expert Solution
Questions # 2:

myArraym can have one level, two levels, or more levels.

Which statement flattens myArray when it can be arbitrarily nested?

Options:

A.

myArray. reduce ((prev, curr) => prev.concat(curr)[ ]);

B.

myArray. join (",").split (",");

C.

[ ] .concat {. . .myArray) ;

D.

myArray.flat(Infinity);

Expert Solution
Questions # 3:

Refer to the following code:

Question # 3

What is the value of output on line 11?

Options:

A.

[1, 2]

B.

[‘’foo’’, ‘’bar’’]

C.

[‘’foo’’:1, ‘’bar’’:2’’]

D.

An error will occur due to the incorrect usage of the for…of statement on line 07.

Expert Solution
Questions # 4:

Given the code below:

Question # 4

What is logged to the console'

Options:

A.

1 2 3 4 5

B.

1 2 5 3 4

C.

2 5 1 3 4

D.

2 5 3 4 1

Expert Solution
Questions # 5:

A developer has two ways to write a function:

Option A:

function Monster() {

This.growl = () => {

Console.log(“Grr!”);

}

}

Option B:

function Monster() {};

Monster.prototype.growl =() => {

console.log(“Grr!”);

}

After deciding on an option, the developer creates 1000 monster objects.

How many growl methods are created with Option A Option B?

Options:

A.

1 growl method iscreated for Option A.1000 growl methods are created for Option B.

B.

1000 growl method is created for Option A. 1 growl methods are created for Option B.

C.

1000 growl methods are created regardless of which option is used.

D.

1 growl method is created regardless of whichoption is used.

Expert Solution
Questions # 6:

Given the followingcode, what is the value of x?

let x = ‘15' + (10 * 2);

Options:

A.

35

B.

50

C.

1520

D.

3020

Expert Solution
Questions # 7:

A developer at Universal Containers creates a new landing page based on HTML, CSS, and

JavaScript TO ensure that visitors have a goodexperience, a script named personaliseContext

needs to be executed when the webpage is fully loaded (HTML content and all related files ), in

order to do some custom initialization.

Which statement should be used to call personalizeWebsiteContent based onthe above

business requirement?

Options:

A.

document.addEventListener(‘’onDOMContextLoaded’, personalizeWebsiteContext);

B.

window.addEventListener(‘load’,personalizeWebsiteContext);

C.

window.addEventListener(‘onload’, personalizeWebsiteContext);

D.

Document.addEventListener(‘‘’DOMContextLoaded’ ,personalizeWebsiteContext);

Expert Solution
Questions # 8:

A developer wants to use a module called DataPrettyPrint. This moduleexports one default functioncalled printDate ().

How can a developer import and use the printDate() function?

A)

Question # 8

B)

Question # 8

C)

Question # 8

D)

Question # 8

Options:

A.

Option A

B.

Option B

C.

Option C

D.

Option D

Expert Solution
Questions # 9:

Refer to the following code block:

class Animal{

constructor(name){

this.name = name;

}

makeSound(){

console.log(`${this.name} ismaking a sound.`)

}

}

class Dog extends Animal{

constructor(name){

super(name)

this.name = name;

}

makeSound(){

console.log(`${this.name} is barking.`)

}

}

let myDog = new Dog('Puppy');

myDog.makeSound();

What is the consoleoutput?

Options:

A.

Puppy is barking

Expert Solution
Questions # 10:

Given the following code:

Counter = 0;

const logCounter = () => {

console.log(counter);

);

logCounter();

setTimeout(logCOunter, 1100);

setInterval(() => {

Counter++

logCounter();

}, 1000);

What is logged by the first four logstatements?

Options:

A.

0 0 1 2

B.

0 1 2 3

C.

0 1 1 2

D.

0 1 2 2

Expert Solution
Viewing page 1 out of 7 pages
Viewing questions 1-10 out of questions