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
Refer to the code below:
Const myFunction = arr => {
Return arr.reduce((result, current) =>{
Return result = current;
}, 10};
}
What is the output of this function when called with an empty array?
- A . Returns 0
- B . Throws an error
- C . Returns 10
- D . Returns NaN
A developer uses a parsed JSON string to work with user information as in the block below:
01 const userInformation ={
02 “ id ”: “user-01”,
03 “email”: “[email protected]”,
04 “age”: 25
Which two options access the email attribute in the object? Choose 2 answers
- A . userInformation(“email”)
- B . userInformation.get(“email”)
- C . userInformation.email
- D . userInformation(email)
bar, awesome is a popular JavaScript module. the versions publish to npm are:
![]()
Teams at Universal Containers use this module in a number of projects.
A particular project has thepackage, json definition below.

A developer runs this command: npm install.
Which version of bar .awesome is installed?
- A . 1.3.1
- B . 1.3.5
- C . The command fails, because version 130 is not found
- D . 1.4.0
Refer to code below:
function Person() {
this.firstName = ’John’;
}
Person.prototype ={
Job: x => ‘Developer’
};
const myFather = new Person();
const result=myFather.firstName + ‘ ‘ + myFather.job();
What is the value of the result after line 10 executes?
- A . Error: myFather.job is not a function
- B . Undefined Developer
- C . John undefined
- D . John Developer
Which statement accurately describes an aspect of promises?
- A . Arguments for the callback function passed to .then() are optional.
- B . In a.then() function, returning results is not necessary since callbacks will catch the result of a previous promise.
- C . .then() cannot be added after a catch.
- D . .then() manipulates and returns the original promise.
Refer to the followingcode:
class Vehicle{
constructor(plate){
this.plate = plate;
}
}
class Truck extends Vehicle{
constructor(plate, weight){
//Missing code
this.weight = weight;
}
displayWeight(){
console.log(`The truck ${this.plate} has a weight of ${this.weight}lb.`);
}
}let myTruck = new Truck(‘123Ab’,5000);
myTruck.displayWeight();
Which statement should be added to missing code for the code to display ‘The truck 123AB has a weight of 5000lb.
- A . super(plate)
- B . super.plate = plate
- C . Vehicle.plate = plate
- D . this.plate= plate
A developer wants to use a module named universalContainersLib and then call functions from it.
How should a developer import every function from the module and then call the functions foo and bar?
- A . import * from ‘/path/universalContainersLib.js’;universalContainersLib. foo ()7universalContainersLib.bar ();
- B . import {foo,bar} from ‘/path/universalCcontainersLib.js’;foo():bar()?
- C . import all from
‘/path/universalContainersLib.js’;universalContainersLib.foo();universalContainersLib.bar (); - D . import * as lib from ‘/path/universalContainersLib.js’;lib.foo();lib. bar ();
A developer is debugging a web server that uses Node.js The server hits a runtime error every third request to an important endpoint on the web server.
The developer added a break point to the start script, that is at index.js at he root of the server’s source code. The developer wants to make use of chrome DevTools to debug.
Which command can be run to access DevTools and make sure the breakdown is hit?
- A . node -i index.js
- B . Node –inspect-brk index.js
- C . Node inspect index.js
- D . Node –inspect index.js
Refer to the following code:

What is the output of line 11?
- A . [1,2]
- B . ["bar", "foo"]
- C . ["foo:1", "bar:2"]
- D . ["foo", "bar"]
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