Summer Certification Limited Time 70% Discount Offer - Ends in 0d 00h 00m 00s - Coupon code = getmirror

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

Practice at least 50% of the questions to maximize your chances of passing.
Exam JavaScript-Developer-I Premium Access

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


723 Students Passed

91% Average Score

94% Same Questions
Viewing page 5 out of 5 pages
Viewing questions 41-50 out of questions
Questions # 41:

Refer to the following array:

Let arr1 = [ 1,2, 3, 4, 5 ];

Question # 41

Which two lines of code result in a second array, arr2 being created such that arr2 is not

a reference to arr1?

Options:

A.

Let arr2 = arr1.slice(0, 5);

B.

Let arr2 = Array.from(arr1);

C.

Let arr2 = arr1;

D.

Let arr2 = arr1.sort();

Questions # 42:

A developer is setting up a Node,js server and is creating a script at the root of the source code, index,js, that will start the server when executed. The developer declares a variable that needsthe folder location that the code executes from.

Which global variable can be used in the script?

Options:

A.

window.location

B.

_filename

C.

_dirname

D.

this.path

Questions # 43:

Given the followingcode, what is the value of x?

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

Options:

A.

35

B.

50

C.

1520

D.

3020

Questions # 44:

A developer has an is Dog function that takes one argument cat. They want to schedule the function to run every minute.

What is the correct syntax for scheduling this function?

Options:

A.

setInterval(isDog, 60000,'cat');

Questions # 45:

Refer to the code snippet below:

Let array = [1, 2, 3, 4, 4, 5, 4, 4];

For (let i =0; i < array.length; i++)

if (array[i] === 4) {

array.splice(i, 1);

}

}

What is the value of array after the code executes?

Options:

A.

[1,2, 3, 4, 5, 4, 4]

B.

[1, 2, 3, 4, 4, 5, 4]

C.

[1, 2, 3, 5]

D.

[1, 2, 3, 4, 5, 4]

Questions # 46:

Given the following code:

let x = null;

console.log(typeof x);

What is the output?

Options:

A.

"object"

B.

"undefined"

C.

"null"

D.

"x"

Questions # 47:

A team that works on a big project uses npm to deal with projects dependencies.

A developer added a dependency does not get downloaded when they execute npm

install.

Which two reasons could be possible explanations for this?

Choose 2 answers

Options:

A.

The developer missed the option --add when adding the dependency.

B.

The developer added the dependency as a dev dependency, andNODE_ENVIs set to production.

C.

The developer missed the option --save when adding the dependency.

D.

The developer added the dependency as a dev dependency, andNODE_ENV is set to production.

Questions # 48:

Refer to the following code:

Let sampleText = ‘The quick brown fox jumps’;

A developer needs to determine if a certainsubstring is part of a string.

Which three expressions return true for the given substring ?

Choose 3 answers

Options:

A.

sampleText.includes(‘fox’);

B.

sampleText.includes(‘ quick ’, 4);

C.

sampleText.includes(‘ Fox ’, 3)

D.

sampleText.includes(‘ fox ’);

E.

sampleText.includes(‘ quick ’) !== -1;

Questions # 49:

A developer wrote a fizzbuzz function thatwhen passed in a number, returns the

following:

● ‘Fizz’ if the number is divisible by 3.

● ‘Buzz’ if the number is divisible by 5.

● ‘Fizzbuzz’ if the number is divisible by both 3 and 5.

● Empty string if the number is divisible by neither 3 or 5.

Whichtwo test cases will properly test scenarios for the fizzbuzz function?

Choose 2 answers

Options:

A.

let res = fizzbuzz(5);console.assert ( res === ‘ ’ );

B.

let res = fizzbuzz(15);console.assert ( res === ‘ fizzbuzz ’ )

C.

let res = fizzbuzz(Infinity);console.assert ( res === ‘ ’ )

D.

let res = fizzbuzz(3);console.assert ( res === ‘ buzz ’ )

Questions # 50:

At Universal Containers, every team has its own way of copying JavaScript objects. The

code

Snippet shows an implementation from one team:

Function Person() {

this.firstName = “John”;

this.lastName = ‘Doe’;

This.name =() => (

console.log(‘Hello $(this.firstName) $(this.firstName)’);

)}

Const john = new Person ();

Const dan =JSON.parse(JSON.stringify(john));

dan.firstName =’Dan’;

dan.name();

What is the Output of the code execution?

Options:

A.

Hello Dan Doe

B.

Hello John DOe

C.

TypeError: dan.name is not a function

D.

TypeError: Assignment to constant variable.

Viewing page 5 out of 5 pages
Viewing questions 41-50 out of questions
TOP CODES

TOP CODES

Top selling exam codes in the certification world, popular, in demand and updated to help you pass on the first try.