Free Salesforce Javascript-Developer-I Exam Questions

Become Salesforce Certified with updated Javascript-Developer-I exam questions and correct answers

Page:    1 / 44      
Total 217 Questions | Updated On: Jan 27, 2025
Add To Cart
Question 1

Refer to the following code:
class Vehicle{
constructor(plate){
this.plate = plate;
}
}
class Truck extends Vehicle{
constructor(plate, weight){
//Missing code
this.weight = weight;
}
displayWeight(){
console.log(`The truck ${this.plate} has a weight of ${this.weight}lb.`);
}
}let myTruck = new Truck('123Ab',5000);
myTruck.displayWeight();
Which statement should be added to missing code for the code to display 'The truck 123AB has a
weight of 5000lb.


Answer: A
Question 2

A developer creates a class that represents a blog post based on the requirement that a
Post should have a body author and view count.
The Code shown Below:
Class Post {
// Insert code here
This.body =body
This.author = author;
this.viewCount = viewCount;
}
}
Which statement should be inserted in the placeholder on line 02 to allow for a variable to be set
to a new instanceof a Post with the three attributes correctly populated?


Answer: C
Question 3

What is the result of the code block?


Answer: D
Question 4

Given the code below:
const copy = JSON.stringify([ new String(' false '), new Bollean( false ), undefined ]);
What is the value of copy?


Answer: D
Question 5

A developer creates a simple webpage with an input field. When a user enters text in
the input field and clicks the button, the actual value of the field must be displayed in the
console.
Here is the HTML file content:
< input type ='' text'' value=''Hello'' name =''input'' >
< button type =''button'' >Display < /button >
The developer wrote the javascript code below:
Const button = document.querySelector('button');
button.addEvenListener('click', () => (
Const input = document.querySelector('input');
console.log(input.getAttribute('value'));
When the user clicks the button, the output is always ''Hello''.
What needs to be done make this code work as expected?


Answer: A
Page:    1 / 44      
Total 217 Questions | Updated On: Jan 27, 2025
Add To Cart

© Copyrights DumpsCertify 2025. All Rights Reserved

We use cookies to ensure your best experience. So we hope you are happy to receive all cookies on the DumpsCertify.