Free JavaScript-Developer-I: Salesforce Certified JavaScript Developer I Exam Questions and Answers
142 verified practice questions for JavaScript-Developer-I.
The first 10 questions on this page are free to read, answers included — no account and no card. A plan opens the rest of the bank, the full timed practice test and your weak-topic reporting.
Last updated: September 19, 2026
- Provider
- Salesforce
- Questions in our bank
- 1000+
- Free to read
- First 10, with answers
- Our test mode duration & pass mark
- 130 mins · 70%
- Verified answers
- Reviewed weekly
- Practice format
- Multiple choice
Recommended: Switch to Test Mode to start a practice test that simulates the real exam experience.
Question #1
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?
Please select an optionIncorrectCorrect answer: A
A const binding cannot be reassigned, so assigning monthName inside the if block throws a TypeError. Declaring it with let makes the reassignment legal and the code runs.
Was this answer correct?Question #2
Refer to the code below: Let str = ‘javascript’; Str[0] = ‘J’; Str[4] = ’S’; After changing the string index values, the value of str is ‘javascript’. What is the reason for this value:
Please select an optionIncorrectCorrect answer: D
Strings are primitives and primitives are immutable, so assigning to an index is silently ignored (non-strict mode) and str keeps its original value.
Was this answer correct?Question #3
A developer has the following array of student test grades: Let arr = [ 7, 8, 5, 8, 9 ]; The Teacher wants to double each score and then see an array of the students who scored more than 15 points. How should thedeveloper implement the request?
Please select an optionIncorrectCorrect answer: C
map doubles every score first and filter then keeps the values above 15, and both are real Array methods with valid arrow syntax. mapBy and filterBy do not exist, and filtering before doubling would apply the threshold to the original scores.
Was this answer correct?Question #4
A developer is creating a simple webpage with a button. When a userclicks 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 every 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

Select 2 answers.
Please select an optionIncorrectCorrect answer: C, D
Either detach the handler with removeEventListener inside the callback after it fires, or register it with the { once: true } option so the browser removes it automatically after the first click.
Was this answer correct?Question #5
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
Select 2 answers.
Please select an optionIncorrectCorrect answer: A, D
CustomEvent takes the event name as the first argument and an options object whose detail property carries the payload, so both forms pass 'update' plus a detail object holding recordId. Passing a single object or a bare string does not create a typed custom event with data.
Was this answer correct?Question #6
Refer to the code below: Let car1 = new Promise((_ , reject) => setTimeout(reject, 2000, “car 1 crashed in” => Let car2 =new Promise(resolve => setTimeout(resolve, 1500, “car 2 completed”) Let car3 =new Promise(resolve => setTimeout(resolve, 3000, “car 3 completed”) Promise.race(( car1, car2, car3)) .t hen (value => ( Let result = ‘$(value) the race.’;)} .catch(arr => { console.log(“Race is cancelled.”, err); }); What isthe value of result when Promise.race executes?
Please select an optionIncorrectCorrect answer: B
Promise.race settles with the first promise to settle; car2 resolves at 1500 ms, before car1 rejects at 2000 ms, so the then block runs and result is built from 'car 2 completed'.
Was this answer correct?Question #7
Given the code below: Function myFunction(){ A =5; Var b =1; } myFunction(); console.log(a); console.log(b); What is the expected output?
Please select an optionIncorrectCorrect answer: B
Assigning a = 5 without a declaration creates an implicit global, so console.log(a) prints 5, while b is declared with var inside the function and is not visible outside, so the next line throws a ReferenceError.
Was this answer correct?Question #8
Refer to HTML below: <div id =”main”> <div id = “ card-00”>This card is smaller.</div> <div id = “card-01”>The width and height of this card is determined by its contents.</div> </div> Which expression outputs the screen width of the element with the ID card-01?
Please select an optionIncorrectCorrect answer: A
getBoundingClientRect() returns the element's actual rendered size on screen, including layout from its contents. The style.width property is empty unless set inline, and div elements have no width property.
Was this answer correct?Question #9
Given the following code: is the output of line 02?
Please select an optionIncorrectCorrect answer: C
Was this answer correct?Question #10
A developer writers the code below to calculate the factorial of a given number. What isthe result of executing line 04?
Please select an optionIncorrectCorrect answer: C
Was this answer correct?
Continue with JavaScript-Developer-I: Salesforce Certified JavaScript Developer I
Unlock the full question bank
You have read the first 10 questions. A subscription opens every question in JavaScript-Developer-I: Salesforce Certified JavaScript Developer I, the full timed practice test, and your progress and weak-topic reporting.
Single exam
$19.99for 30 days
Full question bank and practice test for one exam, for 30 days.
Single exam
$49.99for 1 year
One exam for a full year. Nothing renews and nothing to cancel.
Full access
$39.99/mo
Every exam in the catalogue, month to month.
Full access
$199.99/yr
Every exam in the catalogue for a year.
Already subscribed? Sign in to pick up where you left off.
Other Salesforce certifications
- ADM-201: Administration Essentials for New Admins (opens in a new tab)
- Certified Sales Cloud Consultant (opens in a new tab)
- Certified Platform Developer II (opens in a new tab)
- ADM-211: Administration Essentials for Experienced Admin (opens in a new tab)
- Certified Platform App Builder (opens in a new tab)
- CRT-450: Salesforce Certified Platform Developer I (opens in a new tab)
Reviews
★★★★★
This platform is a lifesaver. The practice questions and explanations are so detailed. It’s the best study tool I’ve ever used.
Hannah Smith
USA
★★★★★
I highly recommend Exam Practice. The feedback after each test helped me improve significantly, and I passed my exams easily.
Oscar Nyström
Sweden
★★★★★
Exam Practice is worth every penny. The mock exams are realistic, and the feedback helped me focus on key areas.
Amit Sharma
India
FAQ
Learn More: https://trailhead.salesforce.com/en/credentials/administratoroverview/
- Q1: What are Salesforce Certification Exams?
- A: Salesforce Certification Exams validate your expertise in using and managing Salesforce’s customer relationship management (CRM) platform. These certifications demonstrate your proficiency in deploying, configuring, and optimizing Salesforce applications to drive business growth and customer engagement.
- Q2: Why should I pursue Salesforce Certification?
- A: Salesforce Certification enhances your professional credibility, showcasing your skills and knowledge in Salesforce solutions. This can lead to better job opportunities, higher salaries, and career advancement in CRM, cloud computing, and IT management roles.
- Q3: What are the benefits of Salesforce Certification?
- A: Benefits include recognition as a certified Salesforce professional, improved job performance, access to exclusive resources, continuing education opportunities, and staying current with the latest Salesforce technologies and best practices.
- Q4: Who should take Salesforce Certification Exams?
- A: CRM administrators, developers, consultants, sales and marketing professionals, and anyone involved in managing and implementing Salesforce solutions should consider these certifications to validate their expertise and advance their careers.
- Q5: What types of Salesforce Certification Exams are available?
- A: Salesforce offers various certification paths, including:
- Q6: How do I prepare for Salesforce Certification Exams?
- A: Preparation can include official Salesforce training courses, study guides, practice exams, online tutorials, and hands-on experience with Salesforce products and solutions.
- Q7: Where can I take Salesforce Certification Exams?
- A: Salesforce Certification Exams can be taken online with remote proctoring or at authorized testing centers worldwide, providing flexibility to fit your schedule and location.
- Q8: How do Salesforce Certifications impact my career?
- A: Salesforce Certifications significantly boost your career by demonstrating your expertise to employers, making you a more competitive candidate for advanced roles and promotions in CRM, cloud computing, and IT management.
- Q9: Are there any prerequisites for Salesforce Certification Exams?
- A: Some exams may have prerequisites, such as foundational knowledge or prior experience with Salesforce products. Check the specific requirements for each certification path on the Salesforce certification website.
- Q10: How often do I need to recertify for Salesforce Certifications?
- A: Salesforce Certifications typically require recertification annually to ensure that certified professionals stay updated with the latest Salesforce technologies and industry practices.



