Created
May 4, 2020 14:26
-
-
Save lantosgyuri/512899e92c0e2f8d69ebfd338a9a0f51 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const arr = [1,2,3]; | |
const arr2 = [4,5,6,[7], [8]]; | |
console.log(arr.concat(arr2)); // not flattened | |
console.log([...arr, ...arr2]); // not flattened | |
console.log(arr.concat(...arr2)); // flattened |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment