Salesforce JavaScript Developer I Practice Exams
Last updated on Oct 22,2026- Exam Code: JavaScript Developer I
- Exam Name: Salesforce Certified JavaScript Developer I
- Certification Provider: Salesforce
- Latest update: Oct 22,2026
Refer to the code below:

What is the result when the Promise in the execute function is rejected?
- A . Resolved1 Resolved2 Resolved3Resolved4
- B . Rejected
- C . Rejected Resolved
- D . Rejected1 Rejected2 Rejected3 Rejected Rejected Rejected4
developer has a web server running with Node.js. The command to start the web server is node server,js. The web server started having latency issues. Instead of a one second turn around for web requests, the developer now sees a five second turnaround.
Which command can the web developer run to see what the module is doing during the latency period?
- A . DEBUG = http, https node server.js
- B . NODE_DEBUG =http, https node server.js
- C . DEBUG =true node server.js
- D . NODE_DEBUG =true node server.js
A developer implements and calls the following code when an application state change occurs:
Const onStateChange =innerPageState) => {
window.history.pushState(newPageState, ‘ ’, null);
}
If the back button is clicked after this method is executed, what can a developer expect?
- A . A navigate event is fired with a state property that details the previous application state.
- B . The page isnavigated away from and the previous page in the browser’s history is loaded.
- C . The page reloads and all Javascript is reinitialized.
- D . A popstate event is fired with a state property that details the application’s last state.
Given the code below:

What is logged to the console’
- A . 12345
- B . 12534
- C . 25134
- D . 25341
Refer to the code below:

Line 05 causes an error.
What are the values of greeting and salutation once code completes?
- A . Greeting is Hello and salutation is Hello, Hello.
- B . Greeting is Goodbye and salutation is Hello, Hello.
- C . Greeting is Goodbye and salutation is I say Hello.
- D . Greeting is Hello and salutation is I say hello.
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
- A . sampleText.includes(‘fox’);
- B . sampleText.includes(‘ quick ’, 4);
- C . sampleText.includes(‘ Fox ’, 3)
- D . sampleText.includes(‘ fox ’);
- E . sampleText.includes(‘ quick ’) !== -1;
Refer to the following array:
Let arr = [1, 2, 3, 4, 5];
Which three options result in x evaluating as [1,2]? Choose 3 answer
- A . let x = arr. slice (2);
- B . let x = arr. slice (0, 2);
- C . let x arr.filter((a) => (return a <= 2 });
- D . let x = arr.filter ((a) => 2 }) ;
- E . let x =arr.splice(0, 2);
Given the code below:
const delay = async delay =>{
return new Promise((resolve,reject)=>{
console.log(1);
setTimeout(resolve,deleay);
});
};
const callDelay =async ()=>{
console.log(2);
const yup = await delay(1000);
console.log(3);
}
console.log(4);
callDelay();
console.log(5);
What is logged to the console?
- A . 42153
A developer has code that calculates a restaurant bill, but generates incorrect answers while testing the code:
function calculateBill (items) {
let total = 0;
total += findSubTotal(items);
total += addTax(total);
total += addTip(total);
return total;
}
Which option allows the developer to step into each function execution within calculateBill?
- A . Using the debugger command on line 05.
- B . Using the debugger command on line 03
- C . Calling the console.trace (total) method on line 03.
- D . Wrapping findSubtotal in a console.log() method.
Universal Containers recently launched its new landing page to host a crowd-funding campaign. The page uses an external library to display some third-party ads.
Once the page is fully loaded, it creates more than 50 new HTML items placed randomly inside the DOM, like the one in the code below:
![]()
All the elements includes the same ad-library-item class, They are hidden by default, and they are randomly displayed while the user navigates through the page.
- A . Use the DOM inspector to prevent the load event to be fired.
- B . Use the browser to execute a script that removes all the element containing the class ad-library-item.
- C . Use the DOM inspector to remove all the elements containing the class ad-library-item.
- D . Use the browser console to execute a script that prevents the load event to be fired.