Skip to content

Instantly share code, notes, and snippets.

@hamirmahal
Last active March 26, 2022 18:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hamirmahal/6647a4dfefb783a8b85bcb1a7d724e54 to your computer and use it in GitHub Desktop.
Save hamirmahal/6647a4dfefb783a8b85bcb1a7d724e54 to your computer and use it in GitHub Desktop.
Spread syntax, ..., test
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