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
Given the following code, what is the value of x?
let x = ‘15′ + (10 * 2);
- A . 35
- B . 50
- C . 1520
- D . 3020
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.
Given the expressionsvar1 and var2, what are two valid ways to return the concatenation of the two expressions and ensure it is string? Choose 2 answers
- A . var1 + var2
- B . var1.toString () var2.toString ()
- C . String (var1) .concat (var2)
- D . string.concat (var1 +var2)
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)
A class was written to represent items for purchase in an online store, and a second class. Representing items that are on sale at a discounted price. The constructor sets the name to the first value passed in.
The pseudocode is below:
Class Item {
constructor(name, price) {
… // Constructor Implementation
}
}
Class SaleItem extends Item {constructor (name, price, discount) {
…//Constructor Implementation
}
}
There is a new requirement for a developer to implement a description method that will return a brief description for Item and SaleItem.
Let regItem =new Item(‘Scarf’, 55);
Let saleItem = new SaleItem(‘Shirt’ 80, -1);
Item.prototype.description = function () { return ‘This is a ’ + this.name; console.log(regItem.description()); console.log(saleItem.description()); SaleItem.prototype.description = function () { return ‘This is a discounted ’ +
this.name; }
console.log(regItem.description());
console.log(saleItem.description());
What is the output when executing the code above?
- A . This is a ScarfUncaught TypeError: saleItem.description is not a functionThis is aScarfThis is a discounted Shirt
- B . This is a ScarfThis is a ShirtThis is a ScarfThis is a discounted Shirt
- C . This is a ScarfThis is a ShirtThis is a discounted ScarfThis is a discounted Shirt
- D . This is aScarfUncaught TypeError: saleItem.description is not a functionThis is a ShirtThis is a did counted Shirt
Refer to the code below:
let timeFunction =() => {
console.log(‘Timer called.”);
};
let timerId = setTimeout (timedFunction, 1000);
Which statement allows a developer to cancel the scheduled timed function?
- A . removeTimeout(timedFunction);
- B . removeTimeout(timerId);
- C . clearTimeout(timerId);
- D . clearTimeout(timedFunction);
Refer to the following array:
Let arr = [ 1,2, 3, 4, 5];
Which three options result in x evaluating as [3, 4, 5]? Choose 3 answers.
- A . Let x= arr.filter (( a) => (a<2));
- B . Let x= arr.splice(2,3);
- C . Let x= arr.slice(2);
- D . Letx= arr.filter((a) => (return a>2 ));
- E . Let x = arr.slice(2,3);
Given the code below:

What is logged to the console’
- A . 12345
- B . 12534
- C . 25134
- D . 25341
What is the default behavior of a Promise object when an error is not caught?
- A . The error is ignored.
- B . The Promise is rejected.
- C . The Promise fails silently.
- D . An exception is thrown globally.
Refer tothe code below:

What is the value of result after line 10 executes?
- A . Error: myFather.job is not a function
- B . John Developer
- C . undefined Developer
- D . John undefined