Languages

JavaScript - How to delete property from spread operator?

0 points
Asked by:
Violetd
925

I want to delete group property from the array of objects but I don't really know how.

Is there any way to delete property from the spread operator?

The object I get from the response looks like this:

Now, what I want to do is to keep everything but group property in the objects:

1 answer
0 points
Answered by:
Admin Dirask Community
4380

You can use rest parameters in object destructuring to get all the properties except group in your array of objects:

 

See also

  1. JavaScript - array destructuring with rest parameter

References

  1. Rest parameters - JavaScript | MDN
0 commentsAdd comment
Donate to Dirask
Our content is created by volunteers - like Wikipedia. If you think, the things we do are good, donate us. Thanks!
Join to our subscribers to be up to date with content, news and offers.
Native Advertising
🚀
Get your tech brand or product in front of software developers.
For more information Contact us
Dirask - we help you to
solve coding problems.
Ask question.

❤️💻 🙂

Join