Salesforce JavaScript Developer I Practice Exams
Last updated on Nov 16,2026- Exam Code: JavaScript Developer I
- Exam Name: Salesforce Certified JavaScript Developer I
- Certification Provider: Salesforce
- Latest update: Nov 16,2026
Universal Containers (UC) notices that its application that allows users to search for accounts makes a network request each time a key is pressed. This results in too many requests for the server to handle.
● Address this problem, UC decides to implement a debounce function on string change handler.
What are three key steps to implement this debounce function? Choose 3 answers:
- A . If there is an existing setTimeout and the search string change, allow the existingsetTimeout to finish, and do not enqueue a new setTimeout.
- B . When thesearch string changes, enqueue the request within a setTimeout.
- C . Ensure that the network request has the property debounce set to true.
- D . If there is an existing setTimeout and the search string changes, cancel the existingsetTimeout using thepersisted timerId and replace it with a new setTimeout.
- E . Store the timeId of the setTimeout last enqueued by the search string change handle.
A developer wants to define a function log to be used a few times on a single-file JavaScript script.
01 // Line 1 replacement
02 console.log(‘"LOG:’, logInput);
03 }
Which two options can correctly replaceline 01 and declare the function for use? Choose 2 answers
- A . function leg(logInput) {
- B . const log(loginInput) {
- C . const log = (logInput) => {
- D . function log = (logInput) {
Refer to the following code:
function test (val) {
If (val === undefined) {
return ‘Undefined values!’ ;
}
if (val === null) {
return ‘Null value! ’;
}
return val;
}
Let x;
test(x);
What is returned by the function call on line 13?
- A . Undefined
- B . Line 13 throws an error.
- C . ‘Undefined values!’
- D . ‘Null value!’
Refer to the following code:
function test (val) {
If (val === undefined) {
return ‘Undefined values!’ ;
}
if (val === null) {
return ‘Null value! ’;
}
return val;
}
Let x;
test(x);
What is returned by the function call on line 13?
- A . Undefined
- B . Line 13 throws an error.
- C . ‘Undefined values!’
- D . ‘Null value!’
What is the output of `console.log(typeof NaN)` in JavaScript?
- A . "undefined"
- B . "number"
- C . "NaN"
- D . "object"
Refer to the code below:
Async funct on functionUnderTest(isOK) {
If (isOK) return ‘OK’;
Throw new Error(‘not OK’);
)
Which assertion accurately tests the above code?
- A . Console.assert (await functionUnderTest(true), ‘OK’)
- B . Console.assert (await functionUnderTest(true), ‘not OK’)
- C . Console.assert (await functionUnderTest(true), ‘notOK’)
- D . Console.assert (await functionUnderTest(true), ‘OK’)
Refer to the code below:

What is the output of this function when called with an empty array?
- A . Return 0
- B . Return 5
- C . Return NaN
- D . Return Infinity
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
- 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;
Given the HTML below:

Which statement adds the priority-account css class to the Applied Shipping row?
- A . document.querySelector(‘#row-as’).classList.add(‘priority-account’);
A developer tries to retrieve all cookies, then sets a certain key value pair in the cookie.
These statements are used:
![]()
What is the behavior?
- A . Cookies are read, but the key value is not set because the value is not URL encoded.
- B . Cookies are not read because line 01 should be document, cookies, but the key value is set and all cookies are wiped.
- C . A Cookies are read and the key value is set, the remaining cookies are unaffected.
- D . Cookies are read and the key value is set, and all cookies are wiped.