Special Summer Sale 70% Discount Offer - Ends in 0d 00h 00m 00s - Coupon code: Board70

JavaScript-Developer-I Exam Dumps - Salesforce Developer Questions and Answers

Question # 24

Refer to the following code:

01 function Tiger(){

02 this.Type = ‘Cat’;

03 this.size = ‘large’;

04 }

05

06 let tony = new Tiger();

07 tony.roar = () =>{

08 console.log(‘They\’re great1’);

09 };

10

11 function Lion(){

12 this.type = ‘Cat’;

13 this.size = ‘large’;

14 }

15

16 let leo = new Lion();

17 //Insert code here

18 leo.roar();

Which two statements could be inserted at line 17 to enable the function call on line 18?

Choose 2 answers.

Options:

A.

Leo.roar = () => { console.log(‘They\’re pretty good:’); };

B.

Object.assign(leo,Tiger);

C.

Object.assign(leo,tony);

D.

Leo.prototype.roar = () => { console.log(‘They\’re pretty good:’); };

Buy Now
Question # 25

Refer to the following code that imports a module named utils:

import (foo, bar) from ‘/path/Utils.js’;

foo() ;

bar() ;

Which two implementations of Utils.js export foo and bar such that the code above runs without

error?

Choose 2 answers

Options:

A.

// FooUtils.js and BarUtils.js exist

Import (foo) from ‘/path/FooUtils.js’;

Import (boo) from ‘ /path/NarUtils.js’;

B.

const foo = () => { return ‘foo’ ; }

const bar = () => { return ‘bar’ ; }

export { bar, foo }

C.

Export default class {

foo() { return ‘foo’ ; }

bar() { return ‘bar’ ; }

}

D.

const foo = () => { return ‘foo’;}

const bar = () => {return ‘bar’; }

Export default foo, bar;

Buy Now
Question # 26

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]

Buy Now
Question # 27

Given the following code:

document.body.addEventListener(‘ click ’, (event) => {

if (/* CODE REPLACEMENT HERE */) {

console.log(‘button clicked!’);

)

});

Which replacement for the conditional statement on line 02 allows a developer to

correctly determine that a button on page is clicked?

Options:

A.

Event.clicked

B.

e.nodeTarget ==this

C.

event.target.nodeName == ‘BUTTON’

D.

button.addEventListener(‘click’)

Buy Now
Question # 28

A developer wants to create an object from a function in the browser using the code below.

What happens due to the lack of the mm keyword on line 02?

Options:

A.

window.name is assigned to 'hello' and the variable = remains undefined.

B.

window.m Is assigned the correct object.

C.

The m variable is assigned the correct object but this.name remains undefined.

D.

The m variable is assigned the correct object.

Buy Now
Question # 29

A developer creates a simple webpage with an input field. When a user enters text in the input field and clicks the button, the actual value of the field must be displayed in the console.

Here is the HTML file content:

<input type =” text” value=”Hello” name =”input”>

The developer wrote the javascript code below:

Const button = document.querySelector(‘button’);

button.addEvenListener(‘click’, () => (

Const input = document.querySelector(‘input’);

console.log(input.getAttribute(‘value’));

When the user clicks the button, the output is always “Hello”.

What needs to be done to make this code work as expected?

Options:

A.

Replace line 04 with console.log(input .value);

B.

Replace line 03 with const input = document.getElementByName(‘input’);

C.

Replace line 02 with button.addCallback(“click”, function() {

D.

Replace line 02 with button.addEventListener(“onclick”, function() {

Buy Now
Question # 30

Refer to code below:

Let first = ‘who’;

Let second = ‘what’;

Try{

Try{

Throw new error(‘Sad trombone’);

}catch (err){

First =’Why’;

}finally {

Second =’when’;

} catch (err) {

Second =’Where’;

}

What are the values for first and second once the code executes ?

Options:

A.

First is Who and second is When

B.

First is why and second is where

C.

First is who and second is where

D.

First is why and second is when

Buy Now
Question # 31

A Developer wrote the following code to test a sum3 function that takes in an array of

numbers and returns the sum of the first three number in the array, The test passes:

Let res = sum2([1, 2, 3 ]) ;

console.assert(res === 6 );

Res = sum3([ 1, 2, 3, 4]);

console.assert(res=== 6);

A different developer made changes to the behavior of sum3 to instead sum all of the numbers

present in the array. The test passes:

Which two results occur when running the test on the updated sum3 function ?

Choose 2 answers

Options:

A.

The line 02 assertion passes.

B.

The line 02 assertion fails

C.

The line 05 assertion passes.

D.

The line 05 assertion fails.

Buy Now
Question # 32

Refer to the code:

Given the code above, which three properties are set for pet1? Choose 3 answers

Options:

A.

name

B.

owner

C.

type

D.

canTalk

E.

size

Buy Now
Question # 33

Refer to the code below:

Let textValue = ’1984’;

Which code assignment shows a correct way to convert this string to an integer?

Options:

A.

let numberValue = Number(textValue);

B.

Let numberValue = (Number)textValue;

C.

Let numberValue = textValue.toInteger();

D.

Let numberValue = Integer(textValue);

Buy Now
Exam Name: Salesforce Certified JavaScript Developer I (WI25)
Last Update: Mar 31, 2025
Questions: 215
JavaScript-Developer-I pdf

JavaScript-Developer-I PDF

$25.5  $84.99
JavaScript-Developer-I Engine

JavaScript-Developer-I Testing Engine

$28.5  $94.99
JavaScript-Developer-I PDF + Engine

JavaScript-Developer-I PDF + Testing Engine

$40.5  $134.99