Skip to content

Instantly share code, notes, and snippets.

@cankemik
Last active August 29, 2015 14:24
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 cankemik/da1395dd78d2c5075d48 to your computer and use it in GitHub Desktop.
Save cankemik/da1395dd78d2c5075d48 to your computer and use it in GitHub Desktop.
js merge arrays
var array1 = [1, 2, 3];
var array2 = [4, 5, 6];
Array.prototype.push.apply(array1, array2);
console.log(array1); // is: [1, 2, 3, 4, 5, 6]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment