Salesforce JavaScript Developer I Practice Exams
Last updated on Oct 21,2026- Exam Code: JavaScript Developer I
- Exam Name: Salesforce Certified JavaScript Developer I
- Certification Provider: Salesforce
- Latest update: Oct 21,2026
Refer to the string below:
const str = ‘Salesforce’;
Which two statements result in the word ‘Sales’? Choose 2 answers
- A . str.substr(1, 5);
- B . str.substr (0, 5);
- C . str.substring (1, 5);
- D . str.substring (0, 5);
Refer to the code below:
Let inArray =[ [ 1, 2 ], [ 3, 4, 5 ] ];
Which two statements result in the array [1, 2, 3, 4, 5]? Choose 2 answers
- A . [ ]. Concat.apply ([ ], inArray);
- B . []. Concat (… inArray);
- C . [ ]. concat.apply(inArray, [ ]);
- D . [ ]. concat ([ ….inArray ] );
The developer has a function that prints “Hello” to an input name.
To test this,thedeveloper created a function that returns “World”. However the following snippet does not print “Hello World”.

What can the developer do to change the code to print “Hello World”?
- A . Change line 7 to) ();
- B . Change line 2 to console.log(‘Hello’,name() );
- C . Change line 9 to sayHello(world) ();
- D . Change line 5 to function world () {
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.
Universal Container (UC) just launched a new landing page, but users complain that the website is slow. A developer found some functions that cause this problem.
To verify this, the developer decides to do everything and log the time each of these three suspicious functions consumes.
console.time(‘Performance’);
maybeAHeavyFunction();
thisCouldTakeTooLong();
orMaybeThisOne();
console.endTime(‘Performance’);
Which function can the developer use to obtain the time spent by every one of the three functions?
- A . console.timeLog()
- B . console.getTime()
- C . console.trace()
- D . console.timeStamp()
Refer to the code below:
Let foodMenu1 = [‘pizza’, ‘burger’, ‘French fries’];
Let finalMenu = foodMenu1;
finalMenu.push(‘Garlic bread’);
What is the value of foodMenu1 after the code executes?
- A . [ ‘pizza’,’Burger’, ‘French fires’, ‘Garlic bread’]
- B . [ ‘pizza’,’Burger’, ‘French fires’]
- C . [ ‘Garlic bread’, ‘pizza’,’Burger’, ‘French fires’ ]
- D . [ ‘Garlicbread’]
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’);
GIven a value, which three options can a developer use to detect if thevalue is NaN? Choose 3 answers
- A . value == NaN
- B . Object.is(value, NaN)
- C . value === Number.NaN
- D . value ! == value
- E . Number.isNaN(value)
Refer to HTML below:
<p> The current status of an Order: <span id =”status”> In Progress </span> </p>.
Which JavaScript statement changes the text ‘In Progress’ to ‘Completed’?
- A . document.getElementById(“status”).Value = ’Completed’ ;
- B . document.getElementById(“#status”).innerHTML = ’Completed’ ;
- C . document.getElementById(“status”).innerHTML = ’Completed’ ;
- D . document.getElementById(“.status”).innerHTML = ’Completed’ ;
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;