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

Exam JavaScript-Developer-I All Questions
Exam JavaScript-Developer-I All Questions

View all questions & answers for the JavaScript-Developer-I exam

Salesforce Developer JavaScript-Developer-I Question # 34 Topic 4 Discussion

JavaScript-Developer-I Exam Topic 4 Question 34 Discussion:
Question #: 34
Topic #: 4

A developer wants to iterate through an array of objects and count the objects and count

the objects whose property value, name, starts with the letterN.

Const arrObj = [{“name” : “Zach”} , {“name” :“Kate”},{“name” : “Alise”},{“name” : “Bob”},{“name” :

“Natham”},{“name” : “nathaniel”}

Refer to the code snippet below:

01 arrObj.reduce(( acc, curr) => {

02 //missing line 02

02 //missing line 03

04 ). 0);

Which missing lines 02 and 03 return the correctcount?


A.

Const sum = curr.startsWith(‘N’) ? 1: 0;Return acc +sum


B.

Const sum = curr.name.startsWith(‘N’) ? 1: 0;Return acc +sum


C.

Const sum = curr.startsWIth(‘N’) ? 1: 0;Return curr+ sum


D.

Const sum =curr.name.startsWIth(‘N’) ? 1: 0;Return curr+ sum


Get Premium JavaScript-Developer-I Questions

Contribute your Thoughts:


Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.