In this article lets discuss how the delete operator in javascript can be your rescuer. I'm jotting down my learning and working experience, so that others may found useful. Recently I came up with a scenario where there is an array of objects with t...
Full stack web developer | A passionate programmer and curious learner | Building https://100daysof.codes
Full Stack Developer. Javascript enthusiastic 😎 A passionate programmer and curious learner 💻
Markdown supported · ⌘↵ to post
Pavan Mehta
You could also use rest operator for doing this.
const { type, status,_id, ...rest} = value const details = { [type]: { ...rest } } return {...acc, ...details}