Salesforce JavaScript-Developer-I - Salesforce Certified JavaScript Developer (JS-Dev-101)
Total 219 questions
Refer to the following code block:
class Animal{
constructor(name){
this.name = name;
}
makeSound(){
console.log(`${this.name} ismaking a sound.`)
}
}
class Dog extends Animal{
constructor(name){
super(name)
this.name = name;
}
makeSound(){
console.log(`${this.name} is barking.`)
}
}
let myDog = new Dog('Puppy');
myDog.makeSound();
What is the console output?
Considering the implications of 'use strict' on line 04, which three statements describe the execution of the code?
Choose 3 answers
A developer has an is Dog function that takes one argument cat. They want to schedule the function to run every minute.
What is the correct syntax for scheduling this function?
A developer is setting up a new Node.js server with a client library that is built using events and callbacks.
The library:
â— Will establish a web socket connection and handle receipt of messages to theserver
â— Will be imported with require, and made available with a variable called we.
The developer also wants to add error logging if a connection fails.
Given this info, which code segment shows the correct way to set up a client with two events that listen at execution time?
Given the code below:
Setcurrent URL ();
console.log(‘The current URL is: ‘ +url );
functionsetCurrentUrl() {
Url = window.location.href:
What happens when the code executes?
Refer tofollowing 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 line 09 for the code to display ‘The truck 123AB has a
weight of 5000lb.’?
A developer at Universal Containers creates a new landing page based on HTML, CSS, and
JavaScript TO ensure that visitors have a goodexperience, a script named personaliseContext
needs to be executed when the webpage is fully loaded (HTML content and all related files ), in
order to do some custom initialization.
Which statement should be used to call personalizeWebsiteContent based onthe above
business requirement?
Refer to the code below:

Which value can a developer expect when referencing country,capital,cityString?
Refer to the code:

Given the code above, which three properties are set pet1?
Choose 3 answers:
What is the result of the code block?
