Summer Sale Special Limited Time 70% Discount Offer - Ends in 0d 00h 00m 00s - Coupon code: xmas50

Salesforce JavaScript-Developer-I - Salesforce Certified JavaScript Developer (JS-Dev-101)

Page: 5 / 5
Total 147 questions

const str = ' Salesforce ' ;

Which two statements result in the word " Sales " ?

A.

str.substring(0, 5);

B.

str.substr(s, 5);

C.

str.substring(0, 5);

D.

str.substr(0, 5);

Given two expressions, exp1 and exp2, which two valid ways return the logical AND of the two expressions and ensure it is a Boolean?

A.

Boolean(exp1 & & exp2)

B.

Boolean(exp1) & & Boolean(exp2)

C.

exp1 & exp2

D.

Boolean(var1) & & Boolean(var2)

01 function changeValue(obj) {

02 obj.value = obj.value / 2;

03 }

04 const objA = { value: 10 };

05 const objB = objA;

06

07 changeValue(objB);

08 const result = objA.value;

What is the value of result?

A.

undefined

B.

5

C.

NaN

D.

10

Refer to the code below:

01 < html lang= " en " >

02 < table onclick= " console.log( ' Table log ' ); " >

03 < tr id= " row1 " >

04 < td > Click me! < /td >

05 < /tr >

06 < /table >

07 < script >

08 function printMessage(event) {

09 console.log( ' Row log ' );

10 event.stopPropagation();

11 }

12

13 let elem = document.getElementById( ' row1 ' );

14 elem.addEventListener( ' click ' , printMessage, false);

15 < /script >

16 < /html >

Which code change should be done for the console to log the following when " Click me! " is clicked?

Row log

Table log

A.

Change line 14 to elem.addEventListener( ' click ' , printMessage, true);

B.

Remove lines 13 and 14

C.

Change line 10 to event.stopPropagation(false);

D.

Remove line 10