Online Access Free JS-Dev-101 Practice Test
| Exam Code: | JS-Dev-101 |
| Exam Name: | Salesforce Certified JavaScript Developer - Multiple Choice |
| Certification Provider: | Salesforce |
| Free Question Number: | 149 |
| Posted: | Sep 01, 2026 |
A developer has two ways to write a function:
Option A:
01 function Monster() {
02 this.growl = () => {
03 console.log("Grr!");
04 }
05 }
Option B:
01 function Monster() {};
02 Monster.prototype.growl = () => {
03 console.log("Grr!");
04 }
After deciding on an option, the developer creates 1000 monster objects. How many growl methods are created with Option A and Option B?
Refer to the code below:
<html>
<body>
<div id="logo">Hello Logo!</div>
<button id="test">Click me</button>
</body>
<script>
function printMessage(event) {
console.log('This is a test message');
}
let el = document.getElementById('test');
el.addEventListener("click", printMessage, false);
</script>
</html>
Which action should be done?