New Year Special 70% Discount Offer - Ends in 0d 00h 00m 00s - Coupon code: Board70

Salesforce Developer JavaScript-Developer-I Release Date

Page: 5 / 8
Question 20

Refer to the following code:

01 function Tiger(){

02 this.Type = ‘Cat’;

03 this.size = ‘large’;

04 }

05

06 let tony = new Tiger();

07 tony.roar = () =>{

08 console.log(‘They\’re great1’);

09 };

10

11 function Lion(){

12 this.type = ‘Cat’;

13 this.size = ‘large’;

14 }

15

16 let leo = new Lion();

17 //Insert code here

18 leo.roar();

Which two statements could be inserted at line 17 to enable the function call on line 18?

Choose 2 answers.

Options:

A.

Leo.roar = () => { console.log(‘They\’re pretty good:’); };

B.

Object.assign(leo,Tiger);

C.

Object.assign(leo,tony);

D.

Leo.prototype.roar = () => { console.log(‘They\’re pretty good:’); };

Question 21

Refer to the code below:

Const pi = 3.1415326,

What is the data type of pi?

Options:

A.

Double

B.

Number

C.

Decimal

D.

Float

Question 22

A developer wants to define a function log to be used a few times on a single-file JavaScript script.

01 // Line 1 replacement

02 console.log('"LOG:', logInput);

03 }

Which two options can correctly replace line 01 and declare the function for use?

Choose 2 answers

Options:

A.

function leg(logInput) {

B.

const log(loginInput) {

C.

const log = (logInput) => {

D.

function log = (logInput) {

Question 23

Refer to 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 line 09 for the code to display ‘The truck 123AB has a

weight of 5000lb.’?

Options:

A.

Super.plate =plate;

B.

super(plate);

C.

This.plate =plate;

D.

Vehicle.plate = plate;

Page: 5 / 8
Exam Name: Salesforce Certified JavaScript Developer I (SU24)
Last Update: Dec 22, 2024
Questions: 215
JavaScript-Developer-I pdf

JavaScript-Developer-I PDF

$25.5  $84.99
JavaScript-Developer-I Engine

JavaScript-Developer-I Testing Engine

$28.5  $94.99
JavaScript-Developer-I PDF + Engine

JavaScript-Developer-I PDF + Testing Engine

$40.5  $134.99