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 code below:
Function Person (firstName, lastName, eyecolor) {
this.firstName =firstName;
this.lastName = lastName;
this.eyeColor = eyeColor;
}
Person.job = ‘Developer’;
const myFather = new Person(‘John’, ‘Doe’);
console.log(myFather.job);
What is the output after the code executes?
- A . ReferenceError: eyeColor is not defined
- B . ReferenceError: assignment to undeclared variable “Person”
- C . Developer
- D . Undefined
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
A developer wants to use a module called DataPrettyPrint. This module exports one default functioncalled printDate ().
How can a developer import and use the printDate() function?
A)
![]()
B)
![]()
C)
![]()
D)
![]()
- A . Option A
- B . Option B
- C . Option C
- D . Option D
Given the code below:
Setcurrent URL ();
console.log(‘The current URL is: ‘ +url );
functionsetCurrentUrl() {
Url = window.location.href:
What happens when the code executes?
- A . The url variable has local scope and line 02 throws an error.
- B . The url variable has global scope and line 02 executes correctly.
- C . The url variable has global scope and line 02 throws an error.
- D . The url variable has local scope and line 02 executes correctly.
A developer has a formatName function that takes two arguments, firstName and lastName and returns a string. They want to schedule the function to run once after five seconds.
What is the correct syntax toschedule this function?
- A . setTimeout (formatName(), 5000, "John", "BDoe");
- B . setTimeout (formatName(‘John’, ‘’Doe’), 5000);
- C . setTimout(() => { formatName("John’, ‘Doe’) }, 5000);
- D . setTimeout (‘formatName’, 5000, ‘John", "Doe’);
Given the code below:
Which three code segments result in a correct conversion from number to string? Choose 3 answers
- A . let strValue = numValue. toString();
- B . let strValue = * * 4 numValue;
- C . let strValue = numValue.toText ();
- D . let scrValue = String(numValue);
- E . let strValue = (String)numValue;
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)
Which three statements are true about promises? Choose 3 answers
- A . The executor of a new Promise runs automatically.
- B . A Promise has a .then() method.
- C . A fulfilled or rejected promise will not change states .
- D . A settled promise can become resolved.
- E . A pending promise canbecome fulfilled, settled, or rejected.
What are two unique features of functions defined with a fat arrow as compared to normal function
definition? Choose 2 answers
- A . The function generated its own this making it useful for separating the function’s scope from its enclosing scope.
- B . The function receives an argument that is always in scope, called parent This, which is the enclosing lexical scope.
- C . If the function has a single expression in the function body, the expression will be evaluated and implicit returned.
- D . The function uses the this from the enclosing scope.
Refer to the code below:
let o = {
get js() {
let city1 = String("st. Louis");
let city2 = String(" New York");
return {
firstCity: city1.toLowerCase(),
secondCity: city2.toLowerCase(),
}
}
}
What value can a developer expect when referencing o.js.secondCity?
- A . Undefined
- B . ‘ new york ’
- C . ‘ New York ’
- D . An error