Refer to the string below:
const str = 'Salesforce';
Which two statements result in the word 'Sales'?
Choose 2 answers
A developer wants to use a module called DataPrettyPrint. This module exports one default functioncalled printDate ().
How can a developer import and use the printDate() function?
A)
B)
C)
D)
A developer has two ways to write a function:
Option A:
function Monster(){
this.growl = ()=>{
console.log('Grr!');
}
}
Option B:
function Monster(){};
Monster.prototype.growl = ()=>{
console.log('Grr!');
}
After deciding on an option, the developercreates 1000 monster objects.
How many growl methods are created with Option A and Option B?
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?
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?