Pass4itsure > Salesforce > Salesforce Developer > JAVASCRIPT-DEVELOPER-I > JAVASCRIPT-DEVELOPER-I Online Practice Questions and Answers

JAVASCRIPT-DEVELOPER-I Online Practice Questions and Answers

Questions 4

Refer to the following object:

const cat ={

firstName: `Fancy',

lastName: ` Whiskers',

Get fullName() {

return this.firstName + ` ` + this.lastName;

}

};

How can a developer access the fullName property for cat?

A. cat.fullName

B. cat.fullName()

C. cat.get.fullName

D. cat.function.fullName()

Buy Now
Questions 5

Given the following code,what is the value of x? let x = `15' + (10 * 2);

A. 35

B. 50

C. 1520

D. 3020

Buy Now
Questions 6

Which option is true about the strict mode in imported modules?

A. Add the statement use non-strict, before any other statements in the module to enable not-strict mode.

B. You can only reference notStrict() functions from the imported module.

C. Imported modules are in strict mode whether you declare them as such or not.

D. Add the statement use strict =false; before any other statements in the module to enable not- strict mode.

Buy Now
Questions 7

Refer tothe code below:

function foo () {

const a =2;

function bat() {

console.log(a);

}

return bar;

}

Why does the function bar have access to variable a ?

A. Inner function's scope

B. Hoisting

C. Outer function's scope

D. Prototype chain

Buy Now
Questions 8

Refer to the code below:

const event = new CustomEvent(

//Missing Code

);

obj.dispatchEvent(event);

A developer needs to dispatch a custom event called update to send information about recordId.

Which two options could a developer insert at the placeholder in line 02 to achieve this?

Choose 2 answers

A. `Update' , ( recordId : `123abc' (

B. `Update' , `123abc'

C. { type : `update', recordId : `123abc' }

D. `Update' , { Details : { recordId : `123abc' } }

Buy Now
Questions 9

Refer to the code below:

new Promise((resolve, reject) => {

const fraction = Math.random();

if( fraction >0.5) reject("fraction > 0.5, " + fraction);

resolve(fraction);

})

.then(() =>console.log("resolved"))

.catch((error) => console.error(error))

.finally(() => console.log(" when am I called?"));

When does Promise.finally on line 08 get called?

A. When rejected

B. When resolved and settled

C. When resolved

D. When resolved or rejected

Buy Now
Questions 10

Refer to the following code:

What isthe value of output on line 11?

A. [1, 2]

B. [`'foo'', `'bar'']

C. [`'foo'':1, `'bar'':2'']

D. An error will occur due to the incorrect usage of the for...of statement on line 07.

Buy Now
Questions 11

Refer to the code below:

for(let number =2 ; number <= 5 ; number += 1 ) {

// insert code statement here

}

Thedeveloper needs to insert a code statement in the location shown. The code statement has these requirements:

1.

Does require an import

2.

Logs an error when the boolean statement evaluates to false

3.

Works in both the browser and Node.js Which meet the requirements?

A. assert (number % 2 === 0);

B. console.error(number % 2 === 0);

C. console.debug(number % 2 === 0);

D. console.assert(number % 2 === 0);

Buy Now
Questions 12

Refer to the following object.

How can a developer access the fullName property for dog?

A. Dog.fullName

B. Dog.fullName ( )

C. Dog, get, fullName

D. Dog, function, fullName

Buy Now
Questions 13

Which javascript methods can be used to serialize an object into a string and deserialize a JSON string into an object, respectively?

A. JSON.stringify and JSON.parse

B. JSON.serialize and JSON.deserialize

C. JSON.encode and JSON.decode

D. JSON.parse and JSON.deserialize

Buy Now
Exam Name: Salesforce Certified JavaScript Developer I
Last Update: Apr 21, 2024
Questions: 223
10%OFF Coupon Code: SAVE10

PDF (Q&A)

$45.99

VCE

$49.99

PDF + VCE

$59.99