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
A developer wants to create an object from a function in the browser using the code below.

What happens due to the lack of the mm keyword on line 02?
- A . window.name is assigned to ‘hello’ and the variable = remains undefined.
- B . window.m Is assigned the correct object.
- C . The m variable is assigned the correct object but this.name remains undefined.
- D . The m variable is assigned the correct object.
Refer to code below:
Let first = ‘who’;
Let second = ‘what’;
Try{
Try{
Throw new error(‘Sad trombone’);
}catch (err){
First =’Why’;
}finally {
Second =’when’;
} catch (err) { Second =’Where’;
}
What are the values for first and second once the code executes?
- A . First is Who and second is When
- B . First is why and second is where
- C . First is who and second is where
- D . First is why and second is when
Given the JavaScript below:

Which code should replace the placeholder comment on line 05 to highlight accounts that match the search string’
- A . ‘yellow’: null
- B . null: ‘yellow’
- C . ‘none1: "yellow’
- D . ‘yellow: ‘none’
Refer to the code below:
Let textValue = ’1984’;
Which code assignment shows a correct way to convert this string to an integer?
- A . let numberValue = Number(textValue);
- B . Let numberValue = (Number)textValue;
- C . Let numberValue = textValue.toInteger();
- D . Let numberValue = Integer(textValue);
The developer wants to test this code:
Const toNumber =(strOrNum) => strOrNum;
Which two tests are most accurate for this code? Choose 2 answers
- A . console.assert(toNumber(‘2’) === 2);
- B . console.assert(Number.isNaN(toNumber()));
- C . console.assert(toNumber(‘-3’) < 0);
- D . console.assert(toNumber () === NaN);
developer has a web server running with Node.js. The command to start the web server is node server,js. The web server started having latency issues. Instead of a one second turn around for web requests, the developer now sees a five second turnaround.
Which command can the web developer run to see what the module is doing during the latency period?
- A . DEBUG = http, https node server.js
- B . NODE_DEBUG =http, https node server.js
- C . DEBUG =true node server.js
- D . NODE_DEBUG =true node server.js
In which situation should a developer include a try .. catch block around their function call?
- A . The function has an error that should not be silenced.
- B . The function results in an out of memory issue.
- C . The function might raise a runtime error that needs to be handled.
- D . The function contains scheduled code.
There is a new requirement for a developer to implement a currPrice method that will return the current price of the item or sales..

What is the output when executing the code above
- A . 50
Uncaught TypeError: saleItem,desrcription is not a function
50
80 - B . 50
80
50
72 - C . 50
80
72 - D . 50
80
Uncaught Reference Error:this,discount is undefined 72
is below:
<input type=”file” onchange=”previewFile()”>
<img src=”” height=”200” alt=”Image Preview…”/>
The JavaScript portion is:
01 functionpreviewFile(){
02 const preview = document.querySelector(‘img’);
3 const file = document.querySelector(‘input[type=file]’).files[0];
4 //line 4 code
5 reader.addEventListener(“load”, () => {
6 preview.src = reader.result;
7 },false);
08 //line 8 code
09 }
In lines 04 and 08, which code allows the user to select an image from their local computer, and to display the image in the browser?
- A . 04 const reader = new File();08 if (file) URL.createObjectURL(file);
- B . 04 const reader = new FileReader();08if (file) URL.createObjectURL(file);
- C . 04 const reader = new File();08 if (file) reader.readAsDataURL(file);
- D . 04 const reader = new FileReader();08 if (file) reader.readAsDataURL(file);
A developer has an ErrorHandler module that contains multiple functions.
What kind of export should be leveraged so that multiple functions can be used?
- A . all
- B . named
- C . multi
- D . default