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?
Answer : A
Refer to code below:
function Person() {
this.firstName = 'John';
}
Person.prototype ={
Job: x => 'Developer'
};
const myFather = new Person();
const result=myFather.firstName + ' ' + myFather.job();
What is the value of the result after line 10 executes?
Answer : A
Given the following code:
document.body.addEventListener(' click ', (event) => {
if (/* CODE REPLACEMENT HERE */) {
console.log('button clicked!');
)
});
Which replacement for the conditional statement on line 02 allows a developer to
correctly determine that a button on page is clicked?
Answer : C
Refer to the code declarations below:
Which three expressions return the string JavaScript?
Choose 3 answers
Answer : B, D, E
A developer copied a JavaScript object:
How does the developer access dan's forstName,lastName? Choose 2 answers
Answer : C, D
Refer of the string below:
Const str = 'sa;esforce'=;
Which two statement result in the word 'Sale'?
Choose 2 answers
Answer : A, B
Refer to the code snippet below:
Let array = [1, 2, 3, 4, 4, 5, 4, 4];
For (let i =0; i < array.length; i++)
if (array[i] === 4) {
array.splice(i, 1);
}
}
What is the value of array after the code executes?
Answer : B