Summer Special Limited Time 60% Discount Offer - Ends in 0d 00h 00m 00s - Coupon code: 8w52ceb345

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

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 correct count?

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

JavaScript-Developer-I PDF/Engine
  • Printable Format
  • Value of Money
  • 100% Pass Assurance
  • Verified Answers
  • Researched by Industry Experts
  • Based on Real Exams Scenarios
  • 100% Real Questions
buy now JavaScript-Developer-I pdf
Get 60% Discount on All Products, Use Coupon: "8w52ceb345"