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:
function changeValue(param) {
Param =5;
}
Let a =10;
Let b =5;
changeValue(b);
Const result = a+ “ – ”+ b;
What is the value of result when code executes?
- A . 10 -10
- B . 5 -5
- C . 5-10
- D . 10-5
A developer receives a comment from the Tech Lead that the code given below has error:
const monthName = ‘July’;
const year = 2019;
if(year === 2019) {
monthName =‘June’;
}
Which line edit should be made to make this code run?
- A . 01 let monthName =’July’;
- B . 02 let year =2019;
- C . 02 const year = 2020;
- D . 03 if (year == 2019) {
A developer has the following array of hourly wages:
Let arr = (8, 5, 9, 75, 11, 25, 7, 75,, 13, 25);
For workers making less than $10 an hour rate should be multiple by 1.25 and returned in a new array.
How should the developer implement the request?
- A . let arrl = arr.filter((val) => val < 10).map((num) -> num = 1.25);
- B . let arrl = arr .rr.acArray ((val) => (val < 10 )),map((num) => { num * 1.25 ));
- C . let arrl = arr-map((num) => { return ran * 1.25 }).filter((val) -> { return val < 10));
- D . let arrl = arr.filterBy((val) => val < 10 ).aapBy<(num) -> num = ..25 );
A developer has the function, shown below, that is called when a page loads.
function onload() {
console.log(“Page has loaded!”);
}
Where can the developer see the log statement after loading the page in the browser?
- A . Terminal running the web server.
- B . Browser performance toots
- C . Browser javaScript console
- D . On the webpage.
Which statement phrases successfully?
- A . JSON.parse (‘ foo ’ );
- B . JSON.parse (“ foo ” );
- C . JSON.parse( “ ‘ foo ’ ” );
- D . JSON.parse(‘ “ foo ” ’);
Given the code below:
FunctionmyFunction(){
A =5; Var b =1;
}
myFunction();
console.log(a);
console.log(b);
What is the expected output?
- A . Both lines 08 and 09 are executed, and the variables are outputted.
- B . Line 08 outputs the variable, but line 09 throws an error.
- C . Line 08thrones an error, therefore line 09 is never executed.
- D . Both lines 08 and 09 are executed, but values outputted are undefined.
Given the code below:
FunctionmyFunction(){
A =5; Var b =1;
}
myFunction();
console.log(a);
console.log(b);
What is the expected output?
- A . Both lines 08 and 09 are executed, and the variables are outputted.
- B . Line 08 outputs the variable, but line 09 throws an error.
- C . Line 08thrones an error, therefore line 09 is never executed.
- D . Both lines 08 and 09 are executed, but values outputted are undefined.
Universal Container (UC) just launched a new landing page, but users complain that the website is slow. A developer found some functions that cause this problem.
To verify this, the developer decides to do everything and log the time each of these three suspicious functions consumes.
console.time(‘Performance’);
maybeAHeavyFunction();
thisCouldTakeTooLong();
orMaybeThisOne();
console.endTime(‘Performance’);
Which function can the developer use to obtain the time spent by every one of the three functions?
- A . console.timeLog()
- B . console.getTime()
- C . console.trace()
- D . console.timeStamp()
Refer to the HTML below:

Which JavaScript statement results in changing “ The Lion.”?
- A . document.querySelectorAll(‘$main $TONY’).innerHTML = ’“ The Lion
- B . document.querySelector(‘$main li:second-child’).innerHTML = “The Lion ’;
- C . document.querySelector(‘$main li.Tony’).innerHTML = ’“ The Lion ’;
- D . document.querySelector(‘$main li:nth-child(2)’),innerHTML = “ The Lion. ’;
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