UPDATED [Feb 05, 2024] Pass Salesforce Certified JavaScript Developer I Exam Exam with Latest Questions
JavaScript-Developer-I Exam Practice Questions prepared by Salesforce Professionals
NEW QUESTION # 19
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.

Answer: C
NEW QUESTION # 20
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
80
72 - B. 50
Uncaught TypeError: saleItem,desrcription is not a function
50
80 - C. 50
80
Uncaught Reference Error:this,discount is undefined
72 - D. 50
80
50
72
Answer: D
NEW QUESTION # 21
Refer to the code snippet:
A developer writes this code to return a message to a user attempting to register a new username. If the username is available, a variable named msg is declared and assigned a value on line 03.
What is the return of msg when getivelibilityMessage ('' bewUserName') is executed and getAvailability (''newUserName'') returns false?
- A. ''newUsername''
- B. undefined
- C. ''msg is not defined''
- D. ''Username available''
Answer: B
NEW QUESTION # 22
A developer is required to write a function that calculates the sum of elements in an array but is getting undefined every time the code is executed. The developer needs to find what is missing in the code below.
Which option makes the code work as expected?
- A. Replace line 05 with return results;
- B. Replace line 03 with if 9 (arr. Length == 0) ( return 0; )
- C. Replace line 02 with return arr. map ( (result, current => (
- D. Replace line 04 with result + current ;
Answer: A
NEW QUESTION # 23
Refer to the following code:
<html lang="en">
<body>
<divonclick = "console.log('Outer message') ;">
<button id ="myButton">CLick me<button>
</div>
</body>
<script>
function displayMessage(ev) {
ev.stopPropagation();
console.log('Inner message.');
}
const elem = document.getElementById('myButton');
elem.addEventListener('click' , displayMessage);
</script>
</html>
What will the console show when the button is clicked?
- A. Outer messageInner message
- B. Inner message
- C. Inner messageOuter message
- D. Outer message
Answer: B
NEW QUESTION # 24
Refer to the code below:
What is the result when the Promise in the execute function is rejected?
- A. Rejected1 Rejected2 Rejected3 Rejected Rejected Rejected4
- B. Rejected
- C. Resolved1 Resolved2 Resolved3
- D. Rejected Resolved
Answer: D
NEW QUESTION # 25
A developer is leading the creation of a new web server for their team that will fulfill API requests from an existing client.
The team wants a web server that runs on Node.Js, and they want to use thenew web framework Minimalist.Js.
The lead developer wants to advocate for a more seasoned back-end framework that already has a community around it.
Which two frameworks could the lead developer advocate for?
Choose 2 answers
- A. Express
- B. Koa
- C. Gatsby
- D. Angular
Answer: C,D
NEW QUESTION # 26
Refer to the code below:
What value can a developer expect when referencing o,js,secondCity?
- A. Undefined
- B. 'New York
- C. 'new york'
- D. An error
Answer: C
NEW QUESTION # 27
A developer copied a JavaScript object:
How does the developer access dan's forstName,lastName? Choose 2 answers
- A. dan,firstname ( ) + dan, lastName ( )
- B. dan, firstName = dan.lastName
- C. dan,name
- D. dan,name ( )
Answer: B,D
NEW QUESTION # 28
developer uses the code below to format a date.
After executing, what is the value of formattedDate?
- A. June 10, 2020
- B. October 05, 2020
- C. May 10, 2020
- D. November 05, 2020
Answer: C
NEW QUESTION # 29
Which code statement below correctly persists an objects in local Storage ?
- A. const setLocalStorage = ( jsObject) => {
window.localStorage.connectObject(jsObject));
} - B. const setLocalStorage = (storageKey, jsObject) => {
window.localStorage.setItem(storageKey, JSON.stringify(jsObject));
} - C. const setLocalStorage = ( jsObject) => {
window.localStorage.setItem(jsObject);
} - D. const setLocalStorage = (storageKey, jsObject) => {
window.localStorage.persist(storageKey, jsObject);
}
Answer: B
Explanation:
NEW QUESTION # 30
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 added the dependency as a dev dependency, and NODE_ENV is set to production.
- B. The developer missed the option --save when adding the dependency.
- C. The developer missed the option --add when adding the dependency.
- D. The developer added the dependency as a dev dependency, and NODE_ENV Is set to production.
Answer: A,B,D
NEW QUESTION # 31
Refer to the code below:
In which sequence will the number be logged?
- A. 0 2 4 1 3
- B. 1 3 0 2 4
- C. 0 1 2 3 4
- D. 0 2 4 3 1
Answer: D
NEW QUESTION # 32
A developer wants to define a function log to be used a few times on a single-file JavaScript script.
01 // Line 1 replacement
02 console.log('"LOG:', logInput);
03 }
Which two options can correctly replace line 01 and declare the function for use?
Choose 2 answers
- A. function log = (logInput) {
- B. function leg(logInput) {
- C. const log(loginInput) {
- D. const log = (logInput) => {
Answer: B,D
NEW QUESTION # 33
A developer is creating a simple webpage with a button. When a user clicks this button for the first time, a message is displayed.
The developer wrote the JavaScript code below, but something is missing. The message gets displayed time a user clicks the button instead of just the first time.
Which two code lines make this code work as required? Choose 2 answers
- A. On line 04, use button. removeEventlistener ('click', listen );
- B. On line 02, use event.first to test if it is the first execution.
- C. On line 06, ad an option called once to button. addEventlistener ( ).
- D. On line 04, use event .stopPropagetion ( );
Answer: A,C
NEW QUESTION # 34
A developer is debugging a web server that uses Node.js. The server hits a runtime error every third request to an important endpoint on the web server.
The developer added a break point to the start script, that is at index, js at the root of the server's source code. The developer wants to make use of Chrome DevTools to debug.
Which command can be run to access DevTools and make sure the breakpoint is hit?
- A. Node inspect index , js
- B. Node -I index , js
- C. Node --inspect -brk index , js
- D. Node -- inspect index ,js
Answer: D
NEW QUESTION # 35
A developer is asked to fix some bugs reported by users. To do that, the developer adds a breakpoint for debugging.
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 information stored in the window.localStorage property.
- B. The value of the carSpeed and fourWheel variables
- C. A variable's displaying the number of instances created for the Car object.
- D. The style, event listeners and other attributes applied to the carSpeed DOM element.
Answer: A,D
NEW QUESTION # 36
Refer to the code below:
01 let car1 = new promise((_, reject) =>
02 setTimeout(reject, 2000, "Car 1 crashed in"));
03 let car2 = new Promise(resolve => setTimeout(resolve, 1500, "Car 2
completed"));
04 let car3 = new Promise(resolve => setTimeout (resolve, 3000, "Car 3
Completed"));
05 Promise.race([car1, car2, car3])
06 .then(value => (
07 let result = $(value) the race. `;
08 ))
09 .catch( arr => (
10 console.log("Race is cancelled.", err);
11 ));
What is the value of result when Promise.race executes?
- A. Car 3 completed the race.
- B. Car 1 crashed in the race.
- C. Car 2 completed the race.
- D. Race is cancelled.
Answer: C
NEW QUESTION # 37
A developer wrote a fizzbuzz function that when passed in a number, returns the
following:
● 'Fizz' if the number is divisible by 3.
● 'Buzz' if the number is divisible by 5.
● 'Fizzbuzz' if the number is divisible by both 3 and 5.
● Empty string if the number is divisible by neither 3 or 5.
Which two test cases will properly test scenarios for the fizzbuzz function?
Choose 2 answers
- A. let res = fizzbuzz(15);
console.assert ( res === ' fizzbuzz ' ) - B. let res = fizzbuzz(5);
console.assert ( res === ' ' ); - C. let res = fizzbuzz(3);
console.assert ( res === ' buzz ' ) - D. let res = fizzbuzz(Infinity);
console.assert ( res === ' ' )
Answer: A,C,D
NEW QUESTION # 38
Given two expressions var1 and var2, what are two valid ways to return the logical AND of the two expression and ensure it is data type Boolean? Choose 2 answers
- A. Var1. Toboolean ( ) && var2, to Boolean ( )
- B. Boolean (var1) && Boolean (var2)
- C. Var1 && var2
- D. Boolean (var1 && var2)
Answer: A,D
NEW QUESTION # 39
Refer to the following code block:
What is the value of output after the code executes?
- A. 0
- B. 1
- C. 2
- D. 3
Answer: A
NEW QUESTION # 40
A developer uses a parsed JSON string to work with user information as in the block below:
Which two option access the email attributes in the object? Choose 2 answers
- A. userInformation. Get (''email'')
- B. userInformation. email
- C. userInformation ( ''email'' )
- D. userInformation(email)
Answer: B,C
NEW QUESTION # 41
A developer is asked to fix some bugs reported by users. To do that, the developer adds
a breakpoint 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 information stored in the window.localStorage property
- B. The values of the carSpeed and fourWheels variables
- C. The style, event listeners and other attributes applied to the carSpeed DOM element
- D. A variable displaying the number of instances created for the Car Object.
Answer: A,C
NEW QUESTION # 42
Which three statements are true about promises ?
Choose 3 answers
- A. A fulfilled or rejected promise will not change states .
- B. A pending promise can become fulfilled, settled, or rejected.
- C. A settled promise can become resolved.
- D. The executor of a new Promise runs automatically.
- E. A Promise has a .then() method.
Answer: A,B,E
NEW QUESTION # 43
......
Salesforce JavaScript-Developer-I Certification Exam is an essential certification for developers who want to demonstrate their expertise in JavaScript development in the Salesforce platform. Passing JavaScript-Developer-I exam not only validates the candidate's skills and knowledge but also opens up new career opportunities in the Salesforce ecosystem. Candidates who pursue this certification will gain valuable experience and knowledge that will help them succeed in their careers as Salesforce developers.
Salesforce JavaScript-Developer-I exam consists of 60 multiple-choice questions that need to be completed in 105 minutes. JavaScript-Developer-I exam covers a range of topics, including JavaScript programming concepts, object-oriented programming, debugging and testing, and integrating with Salesforce. To prepare for the exam, candidates can take the official Salesforce training course, review the official exam guide, and practice with sample questions and exams. Passing the exam requires a minimum score of 65%, and the exam fee is $200 USD.
JavaScript-Developer-I Exam Practice Materials Collection: https://www.lead1pass.com/Salesforce/JavaScript-Developer-I-practice-exam-dumps.html
Use Valid New JavaScript-Developer-I Questions - Top choice Help You Gain Success: https://drive.google.com/open?id=1EgCcqbJBBIycTTVhEeB3lSC1iWisjFfm