Created
August 13, 2013 03:10
-
-
Save fatgy/6217569 to your computer and use it in GitHub Desktop.
Array merge with push
From http://tech.pro/tutorial/1453/7-javascript-basics-many-developers-aren-t-using-properly
This file contains hidden or 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
var mergeTo = [4,5,6]; | |
var mergeFrom = [7,8,9]; | |
Array.prototype.push.apply(mergeTo, mergeFrom); | |
mergeTo; // is: [4, 5, 6, 7, 8, 9] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment