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:

Considering that JavaScript is single-threaded, what is the output of line 08 after the code executes?
- A . 10
- B . 11
- C . 12
- D . 13
Refer the code below.
x=3.14;
function my function() {
"use strict";
y=x;
}
z=x;
myFunction();
Use strict has effect only on line 5.
Line 5 throws an error
A developer is asked to fix some bugs reported by users. To do that, the developer adds abreakpoint for debugging.
Function Car (maxSpeed, color) {
This.maxspeed =masSpeed;
This.color = color;
Let carSpeed = document.getElementById(‘ CarSpeed’);
Debugger;
Let fourWheels =new Car (carSpeed.value, ‘red’);
When the code execution stops at the breakpoint on line 06, which two types of information are available in the browser console? Choose 2 answers:
- A . The values of the carSpeed and fourWheels variables
- B . A variable displaying the number of instances created for the Car Object.
- C . The style, event listeners and other attributes applied to the carSpeed DOM element
- D . The information stored in the window.localStorage property
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 following code:
01 function Tiger(){
02this.Type = ‘Cat’;
03 this.size = ‘large’;
4 }
5
6 let tony = new Tiger();
7 tony.roar = () =>{
8 console.log(‘They’re great1’);
9 };
10
11 function Lion(){
12 this.type = ‘Cat’;
13 this.size = ‘large’;
14 }
15
16 let leo = new Lion();
17 //Insertcode here
18 leo.roar();
Which two statements could be inserted at line 17 to enable the function call on line 18? Choose 2 answers.
- A . Leo.roar = () => {console.log (‘They’re pretty good:’);};
- B . Object.assign(leo,Tiger);
- C . Object.assign(leo,tony);
- D . Leo.prototype.roar = () => { console.log(‘They’re pretty good:’); };
Refer the following code

What is the value of array after code executes?
Refer to the code below:

Line 05 causes an error.
What are the values of greeting and salutation once code completes?
- A . Greeting is Hello and salutation is Hello, Hello.
- B . Greeting is Goodbye and salutation is Hello, Hello.
- C . Greeting is Goodbye and salutation is I say Hello.
- D . Greeting is Hello and salutation is I say hello.
Refer to the code below:
const event = new CustomEvent(
//Missing Code
);
obj.dispatchEvent(event);
A developer needs to dispatch a custom event called update to send information about recordId.
Which two options could a developer insert at the placeholder in line 02 to achieve this? Choose 2 answers
- A . ‘Update’, (recordId: ‘123abc’(
- B . ‘Update’, ‘123abc’
- C . {type: ‘update’, recordId: ‘123abc’}
- D . ‘Update’, {Details: {recordId: ‘123abc’}}
Refer to code below:
Function muFunction(reassign){
Let x = 1;
var y = 1;
if (reassign) {
Let x= 2;
Var y = 2;
console.log(x);
console.log(y);}
console.log(x);
console.log(y);}
What is displayed when myFunction(true) is called?
- A . 2211
- B . 2 2 undefined undefined
- C . 2212
- D . 2222
A developer wants to use a try…catch statement to catch any error that countSheep () may throw and pass it to a handleError () function.
What is the correct implementation of the try…catch?
A)

B)

C)

D)

- A . Option
- B . Option
- C . Option
- D . Option