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 following code:

Which statement should be added to line 09 for the code to display. The boat has a capacity of 10 people?
- A . super.size = size;
- B . ship.size size;
- C . super (size);
- D . this.size = size;
Refer to the following code:
Let obj ={
Foo: 1,
Bar: 2
}
Let output =[],
for(let something in obj{
output.push(something);
}
console.log(output);
What is the output line 11?
- A . [1,2]
- B . [“bar”,”foo”]
- C . [“foo”,”bar”]
- D . [“foo:1”,”bar:2”]
A developer creates a class that represents a blog post based on the requirement that a Post should have a body author and view count.
The Code shown Below:
Class Post{
// Insert code here This.body =body This.author = author; this.viewCount = viewCount;
}
}
Which statement should be inserted in the placeholder on line 02 to allow for a variable to be set to a new instanceof a Post with the three attributes correctly populated?
- A . super (body, author, viewCount) {
- B . Function Post (body, author, viewCount) {
- C . constructor (body, author, viewCount) {
- D . constructor () {
Refer to the code below:
Const pi = 3.1415326,
What is the data type of pi?
- A . Double
- B . Number
- C . Decimal
- D . Float
What is the result of the code block?
- A . The console logs only ‘flag’.
- B . The console logs ‘flag’ and another flag.
- C . An error is thrown.
- D . The console logs ‘flag’ and then an error is thrown.
A developer writes the code below to return a message to a user attempting to register a new username.
If the username is available, a variable named nag is declared and assigned a value on line 03.

What is the value of msg when getAvailableabilityMessage (“newUserName”) is executed and get Availability (“newUserName”) returns true?
- A . "msg is not defined"
- B . "newUserName"
- C . "User-name available"
- D . undefined
Refer to the code snippet below:
Let array = [1, 2, 3, 4, 4, 5, 4, 4];
For (let i =0; i <array.length; i++){
if (array[i] === 4) {
array.splice(i, 1);
}
}
What is the value of the array after the code executes?
- A . [1, 2, 3, 4, 5, 4, 4]
- B . [1, 2, 3, 4, 4, 5, 4]
- C . [1, 2, 3, 4, 5, 4]
- D . [1, 2, 3, 5]
Which statement accurately describes the behaviour of the async/ await keyworks?
- A . The associated class contains some asynchronous functions.
- B . The associated function will always return a promise
- C . The associated function can only be called via asynchronous methods
- D . The associated sometimes returns a promise.
A developer has two ways to write a function:
Option A:
function Monster(){
this.growl = ()=>{
console.log(‘Grr!’);
}
}
Option B:
function Monster(){};
Monster.prototype.growl = ()=>{
console.log(‘Grr!’);
}
After deciding on an option, the developercreates 1000 monster objects.
How many growl methods are created with Option A and Option B?
- A . 1000 for Option A, 1 for Option B
- B . 1 methods for both
- C . 1000 for both
- D . 1 for Option A, 1000 for Option B
Which javascript methods can be used to serialize an object into a string and deserialize a JSON string into an object, respectively?
- A . JSON.stringify and JSON.parse
- B . JSON.serialize and JSON.deserialize
- C . JSON.encode and JSON.decode
- D . JSON.parse and JSON.deserialize