Skip to content
Advertisement

Get a specific object from an array of objects [closed]

Here is the sample input

JavaScript

How to get an output that would be like

JavaScript

Thank you in advance

Advertisement

Answer

You could use .reduce() like so:

JavaScript
User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement