New Year Special Sale Limited Time 70% Discount Offer - Ends in 0d 00h 00m 00s - Coupon code: scxmas70

JavaScript-Developer-I Exam Dumps - Salesforce Certified JavaScript Developer I (SU24)

Go to page:
Question # 25

Refer to the code below:

Function changeValue(obj) {

Obj.value = obj.value/2;

}

Const objA = (value: 10);

Const objB = objA;

changeValue(objB);

Const result = objA.value;

What is the value of result after the code executes?

A.

10

B.

Nan

C.

5

D.

Undefined

Full Access
Question # 26

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

Full Access
Question # 27

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:

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?

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() {

Full Access
Question # 28

Refer the following code

what is the value of array after code executes?

Full Access
Question # 29

A developer has the function, shown below, that is called when a page loads.

Where can the developer see the log statement after loading the page in the browser?

A.

On the browser JavaScript console

B.

On the terminal console running the web server

C.

In the browser performance tools log

D.

On the webpage console log

Full Access
Question # 30

Which code statement correctly retrieves and returns an object from localStorage?

A.

const retrieveFromLocalStorage = () =>{

return JSON.stringify(window.localStorage.getItem(storageKey));

}

B.

const retrieveFromLocalStorage = (storageKey) =>{

return window.localStorage.getItem(storageKey);

}

C.

const retrieveFromLocalStorage = (storageKey) =>{

return JSON.parse(window.localStorage.getItem(storageKey));

}

D.

const retrieveFromLocalStorage = (storageKey) =>{

return window.localStorage[storageKey];

}

Full Access
Question # 31

A developer creates an object where its properties should be immutable and prevent

properties from being added or modified.

Which method should be used to execute this business requirement ?

A.

Object.const()

B.

Object.eval()

C.

Object.lock()

D.

Object.freeze()

Full Access
Question # 32

Refer to the code below?

Let searchString = ‘ look for this ’;

Which two options remove the whitespace from the beginning of searchString?

Choose 2 answers

A.

searchString.trimEnd();

B.

searchString.trimStart();

C.

trimStart(searchString);

D.

searchString.replace(/*\s\s*/, ‘’);

Full Access
Go to page: