Closed richzw closed 8 years ago
Using spread operator in ES6
var myNewArray4 = [].concat(...myArray); console.log(myNewArray4); // [1, 2, 3, 4, 5, 6, 7, 8, 9]
@zangw
To recursively flattens array, one good method flattenDeep could do that. However, the flatten in underscore only be flattened a single level.
flattenDeep
flatten
thanks!!
Add one solution in ES6 for 2016-02-07 tips
TL;DR;
Using spread operator in ES6
Username
@zangw
Extra
To recursively flattens array, one good method
flattenDeep
could do that. However, theflatten
in underscore only be flattened a single level.