Salesforce CRT-600 Prepare for your JavaScript Developer I Certification Exam Practice Test

Page: 1 / 14
Total 224 questions
Question 1

Refer to the following 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 missing code for the code to display 'The truck 123AB has a

weight of 5000lb.



Answer : A


Question 2

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 developer creates 1000 monster objects.

How many growl methods are created with Option A and Option B?



Answer : B


Question 3

Refer to the code below

let inArray = [[1,2],[3,4,5]];

which two statements results in the array [1,2,3,4,5]?

choose 2 answer



Answer : A, D


Question 4

At Universal Containers, every team has its own way of copying JavaScript objects. The code snippet shows an Implementation from one team:

What is the output of the code execution?



Answer : D


Question 5

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.



Answer : C


Question 6

Given the HTML below:

Which statement adds the priority-account CSS class to the Universal Containers row?



Answer : D


Question 7

Given the code below:

What is logged to the console'



Answer : D


Page:    1 / 14   
Total 224 questions