How to transfer class array to array in ES6
This article is about how to convert class arrays to arrays in ES6. The editor thinks it is very practical, so share it with you as a reference and follow the editor to have a look.
Conversion method
ES6 has a few more ways to convert an array of classes into an array.
Use the extension operator
Function func () {console.log ([... arguments])} func ('Google',' facebook', 'Microsoft'); / / [' Google', 'facebook',' Microsoft']
Use Array.from
Function func () {console.log (Array.from (arguments))} func ('Google',' facebook', 'Microsoft'); / / [' Google', 'facebook',' Microsoft'] Thank you for reading! This is the end of the article on "how to transfer a class array to an array in ES6". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, you can share it out for more people to see!