Skip to content
Advertisement

destructing es6 in array push

i want to use something like destructing assignment in ES6 for having cleaner code but i dont know how to use it in something like pushing in array or anyway can is use it or something similar?. this sample code is in vue js:

JavaScript

Advertisement

Answer

Try this code:

JavaScript

or this:

JavaScript

And then you can remove unnecessary words, like this:

JavaScript
User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement