Salesforce Certified JavaScript Developer I Practice Test - Questions Answers, Page 21
List of questions
Related questions
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?
Refer to the following code block:
class Animal{
constructor(name){
this.name = name;
}
makeSound(){
console.log(`${this.name} is making a sound.`)
}}
class Dog extends Animal{
constructor(name){
super(name)
this.name = name;
}
makeSound(){
console.log(`${this.name} is barking.`)
}}l
et myDog = new Dog('Puppy');
myDog.makeSound();
What is the console output?
Given the HTML below:
Which statement adds the priority-account css class to the Applied Shipping row?
Refer to the HTML below:
Which JavaScript statement results in changing " The Lion."?
Refer to the code below:
Which replacement for the conditional statement on line 02 allows a developer to correctly determine that a specific element, myElement on the page had been clicked?
Given the following code:
let x = null;
console.log(typeof x);
What is the output?
Refer to the code below:
let car1 = new Promise((_ ,reject)=> setTimeout(reject,2000,"Car1 crashed in"));
let car2 = new Promise(resolve => setTimeout(resolve,1500,"Car2 completed"));
let car3 = new Promise(resolve => setTimeout(resolve,3000,"Car3 completed"));
Promise.race([car1,car2,car3])
.then(value=>{
let result = `${value} the race.`;
}).catch(err=>{
console.log('Race is cancelled.',err);
});
What is the value of result when promise.race execues?
Given the code below:
const delay = async delay =>{
return new Promise((resolve,reject)=>{
console.log(1);
setTimeout(resolve,deleay);
});
};
const callDelay = async ()=>{
console.log(2);
const yup = await delay(1000);
console.log(3);
}
console.log(4);
callDelay();
console.log(5);
What is logged to the console?
A developer writes the code below to calculate the factorial of a given number
function sum(number){
return number * sum(number-1);
}
sum(3);
what is the result of executing the code.
Question