DEV Community

Bagas Teguh imani
Bagas Teguh imani

Posted on

Help me with this JS code please..

https://stackoverflow.com/q/62450635/13769179

Top comments (1)

Collapse
 
hemant profile image
Hemant Joshi • Edited

Destructuring could help you better and mapping the input to output

let output = input.map(([ID, Name, Born_Place, Birthday, Hobby ]) => ({ID, Name, ["Born Place"]:Born_Place, Birthday, Hobby}))
console.log(output);