Salesforce JavaScript Developer I Practice Exams
Last updated on Oct 01,2026- Exam Code: JavaScript Developer I
- Exam Name: Salesforce Certified JavaScript Developer I
- Certification Provider: Salesforce
- Latest update: Oct 01,2026
Given the following code:
![]()
is the output of line 02?
- A . ”x”
- B . ”null”’
- C . ”object”
- D . ”undefined”
Refer to code below:
Let a =’a’;
Let b;
// b = a; console.log(b);
What is displayed when the code executes?
- A . ReferenceError: b is not defined
- B . A
- C . Undefined
- D . Null
Given the JavaScript below:
01 function filterDOM (searchString) {
02 const parsedSearchString = searchString && searchString.toLowerCase() ;
03 document.quesrySelectorAll(‘ .account’ ) . forEach(account => (
04 const accountName = account.innerHTML.toLOwerCase();
05 account. Style.display = accountName.includes(parsedSearchString)? /*Insert code*/;
6 )};
7 }
Which code should replace the placeholder comment on line 05 to hide accounts that do not match the search string?
- A . ‘ name ’: ‘ block ’
- B . ‘ Block ’: ‘ none ’
- C . ‘ visible ’: ‘ hidden ’
- D . ‘ hidden ’: ‘ visible ’
Given the HTML below:

Which statement adds the priority-account CSS class to the Universal Containers row?
- A . document. querySelector (#row-uc’).classes-push(‘priority-account’);
- B . document. getElementByid(‘row-uc’).addClass(‘priority-account*);
- C . document. querySelectorAll(‘#row-uc’) -classList.add("priority-accour’);
- D . document. queryselector(‘#row-uc’).ClassList.add(‘priority-account’);
A developer has an ErrorHandler module that contains multiple functions.
What kind of export be leverages so that multiple functions can beused?
- A . Named
- B . All
- C . Multi
- D . Default
Refer to the following code block:
class Animal{
constructor(name){
this.name = name;
}
makeSound(){
console.log(`${this.name} ismaking a sound.`)
}
}
class Dog extends Animal {
constructor(name) {
super(name)
this.name = name;
}
makeSound(){
console.log(`${this.name} is barking. `)
}
}
let myDog = new Dog(‘Puppy’);
myDog.makeSound();
What is the console output?
- A . Puppy is barking
Refer to the following code block:
class Animal{
constructor(name){
this.name = name;
}
makeSound(){
console.log(`${this.name} ismaking a sound.`)
}
}
class Dog extends Animal {
constructor(name) {
super(name)
this.name = name;
}
makeSound(){
console.log(`${this.name} is barking. `)
}
}
let myDog = new Dog(‘Puppy’);
myDog.makeSound();
What is the console output?
- A . Puppy is barking
Refer to the codebelow:
function foo () {
const a =2;
function bat() {
console.log(a);
}
return bar;
}
Why does the function bar have access to variable a?
- A . Inner function’s scope
- B . Hoisting
- C . Outer function’s scope
- D . Prototype chain
Given the following code:
document.body.addEventListener(‘ click ’, (event) => {
if (/* CODE REPLACEMENT HERE */) {
console.log(‘button clicked!’);
)
});
Which replacement for the conditional statement on line 02 allows a developer to correctly determine that a button on page is clicked?
- A . Event.clicked
- B . e.nodeTarget ==this
- C . event.target.nodeName == ‘BUTTON’
- D . button.addEventListener(‘click’)
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