How to Convert a List of Inverted Data to Its Standard Form

Quick start with the array reduce method

Photo by the author, Spetses island

Think of a list of movie objects. In its standard form, it may look something like this.

const movies = [
{id: 1, name: 'The Dark Knight ', year: 2008},
{id: 2, name: ' Jokers', year: 2019}
];

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store