Salesforce Javascript Developer I Salesforce Certified JavaScript Developer I Exam Practice Test

Page: 1 / 14
Total 224 questions
Question 1

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


Question 2

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


Question 3

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


Question 4

Refer to the code declarations below:

Which three expressions return the string JavaScript?

Choose 3 answers



Answer : B, D, E


Question 5

A developer copied a JavaScript object:

How does the developer access dan's forstName,lastName? Choose 2 answers



Answer : C, D


Question 6

Refer of the string below:

Const str = 'sa;esforce'=;

Which two statement result in the word 'Sale'?

Choose 2 answers



Answer : A, B


Question 7

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


Page:    1 / 14   
Total 224 questions