Last active
March 26, 2022 18:34
-
-
Save hamirmahal/6647a4dfefb783a8b85bcb1a7d724e54 to your computer and use it in GitHub Desktop.
Spread syntax, ..., test
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 a = [ 1, 2, 3 ] | |
const b = [ 4, 5, 6 ]; | |
const c = [ ...a, ...b ]; | |
b.push(7); | |
console.log(a, b, c); | |
// > Array [1, 2, 3] Array [4, 5, 6, 7] Array [1, 2, 3, 4, 5, 6] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment