Skip to content

Instantly share code, notes, and snippets.

@tkssharma
Created March 19, 2019 03:21
Show Gist options
  • Save tkssharma/e3b483578367c615ab92007719ff6b71 to your computer and use it in GitHub Desktop.
Save tkssharma/e3b483578367c615ab92007719ff6b71 to your computer and use it in GitHub Desktop.
// spread operator doing the concat job
let arr = [1,2,3];
let arr2 = [4,5];
arr = [...arr,...arr2];
console.log(arr); // [ 1, 2, 3, 4, 5 ]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment