Skip to content

Instantly share code, notes, and snippets.

@yardfarmer
Created April 10, 2016 15:14
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 yardfarmer/bff534ba0dfe39382998e59951318ded to your computer and use it in GitHub Desktop.
Save yardfarmer/bff534ba0dfe39382998e59951318ded to your computer and use it in GitHub Desktop.
巧妙的数组合并 merge
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