Online Access Free JS-Dev-101 Exam Questions
| Exam Code: | JS-Dev-101 |
| Exam Name: | Salesforce Certified JavaScript Developer - Multiple Choice |
| Certification Provider: | Salesforce |
| Free Question Number: | 149 |
| Posted: | Sep 02, 2026 |
Refer to the following object:
const dog = {
firstName: 'Beau',
lastName: 'Boo',
get fullName() {
return this.firstName + ' ' + this.lastName;
}
};
How can a developer access the fullName property for dog?
Refer to the code below:
01 new Promise((resolve, reject) => {
02 const fraction = Math.random();
03 if (fraction > 0.5) reject('fraction > 0.5, ' + fraction);
04 resolve(fraction);
05 })
06 .then(() => console.log('resolved'))
07 .catch((error) => console.error(error))
08 .finally(() => console.log('when am I called?'));
When does Promise.finally on line 08 get called?
A developer at Universal Containers creates a new landing page based on HTML, CSS, and JavaScript.
To ensure that visitors have a good experience, a script named personalizeWebsiteContent needs to be executed to do some custom initialization when the webpage is fully loaded with HTML content and all related files.
Which statement should be used to call personalizeWebsiteContent based on the above business requirement?
Original code:
01 let requestPromise = client.getRequest;
03 requestPromise().then((response) => {
04 handleResponse(response);
05 });
The developer wants to gracefully handle errors from a Promise-based GET request.
Which code modification is correct?