---
title: "Comment by Pavan Mehta on \"How the delete operator can be your super saver!\" | Hashnode"
description: "You could also use rest operator for doing this. const { type , status,_id, ...rest} = value const details = { [ type ]: { ...rest } } return {...acc, ...detail"
url: "https://hashnode.com/posts/how-the-delete-operator-can-be-your-super-saver/5f781a057d160d41227d7273/comment/5f7a72819c3b6e4101217c03"
---

[Discussion](https://hashnode.com/posts/how-the-delete-operator-can-be-your-super-saver/5f781a057d160d41227d7273)

Comment [How the delete operator can be your super saver!](https://hashnode.com/posts/how-the-delete-operator-can-be-your-super-saver/5f781a057d160d41227d7273)

[Pavan Mehta](https://hashnode.com/@pavanmehta)

[Oct 5, 2020](https://hashnode.com/posts/how-the-delete-operator-can-be-your-super-saver/5f781a057d160d41227d7273/comment/5f7a72819c3b6e4101217c03)

You could also use rest operator for doing this.

```
const { type, status,_id, ...rest} = value
            const details  = {
                        [type]: {
                        ...rest
                }
            }
            return {...acc, ...details}
```
