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 two expressions var1 and var2.
What are two valid ways to return the logical AND of the two expressions and ensure it is data type Boolean? Choose 2 answers:
- A . Boolean(var1 && var2)
- B . var1 && var2
- C . var1.toBoolean() && var2toBoolean()
- D . Boolean(var1) && Boolean(var2)
Given the code below:
01 function GameConsole (name) {
02 this.name = name;
3 }
4
5 GameConsole.prototype.load = function(gamename) {
6 console.log (` $(this.name) is loading agame: $(gamename) …`);
7 )
8 function Console 16 Bit (name) {
9 GameConsole.call(this, name) ;
10 }
11 Console16bit.prototype = Object.create (GameConsole.prototype) ;
12 //insert code here
13 console.log (` $(this.name) is loading a cartridge game :$(gamename) …`);
14 }
15 const console16bit = new Console16bit(‘ SNEGeneziz ’);
16 console16bit.load(‘Super Nonic 3x Force’);
What should a developer insert at line 15 to output the following message using the method?
> SNEGeneziz is loading a cartridgegame: Super Monic 3x Force . . .
- A . Console16bit.prototype.load(gamename) = function() {
- B . Console16bit.prototype.load = function(gamename) {
- C . Console16bit = Object.create(GameConsole.prototype).load = function(gamename) {
- D . Console16bit.prototype.load(gamename) {
A test has a dependency on database.query. During the test the dependency is replaced with an object called database with the method, query, that returns an array. The developer needs to verify how many times the method was called and the arguments used each time.
Which two test approaches describe the requirement? Choose 2 answers
- A . Integration
- B . Black box
- C . White box
- D . Mocking
A developer is trying to handle an error within a function.
Which code segment shows the correct approach to handle an error without propagating it elsewhere?
A)

B)

C)

D)

- A . Option A
- B . Option B
- C . Option C
- D . Option D
developer publishes a new version of a package with new features that do not break backward compatibility. The previous version number was 1.1.3.
Following semantic versioning format, what should the new package version number be?
- A . 2.0.0
- B . 1.2.3
- C . 1.1.4
- D . 1.2.0
A team that works on a big project uses npm to deal with projects dependencies.
A developer added a dependency does not get downloaded when they execute npm install.
Which two reasons could be possible explanations for this? Choose 2 answers
- A . The developer missed the option –add when adding the dependency.
- B . The developer added the dependency as a dev dependency, and NODE_ENVIs set to production.
- C . The developer missed the option –save when adding the dependency.
- D . The developer added the dependency as a dev dependency, and NODE_ENV is set to production.
A developer wants to set up a secure web server withNode.js. The developer creates a directory locally called app-server, and the first file is app-server/index.js
Without using any third-party libraries, what should the developer add to index.js to create the secure web server?
- A . const https =require(‘https’);
- B . const server =require(‘secure-server’);
- C . const tls = require(‘tls’);
- D . const http =require(‘http’);
Teams at Universal Containers (UC) work on multiple JavaScript projects at the same time.
UC is thinking about reusability and how each team can benefit from the work of others.
Going open-source or public is not an option at this time.
Which option is available to UC with npm?
- A . Private packages can be scored, andscopes can be associated to a privateregistries.
- B . Private registries are not supported by npm, but packages can be installed via URL.
- C . Private packages are not supported, but they can use another package manager likeyarn.
- D . Private registries are not supported by npm, but packages can be installed via git.
A developer writes the code below to calculate the factorial of a given number function sum(number) {return number * sum(number-1);
}
sum (3);
What is the result of executing the code.
- A . 0
- B . 6
- C . Error
- D . -Infinity
Which code statement below correctly persists an objects in local Storage?

- A . const setLocalStorage = (storageKey, jsObject) => {window.localStorage.setItem(storageKey, JSON.stringify(jsObject));}
- B . const setLocalStorage = (jsObject) => {window.localStorage.connectObject(jsObject));}
- C . const setLocalStorage= (jsObject) => {window.localStorage.setItem(jsObject);}
- D . const setLocalStorage = (storageKey, jsObject) => {window.localStorage.persist(storageKey, jsObject);}