Skip to content

Instantly share code, notes, and snippets.

@kennir
Last active March 14, 2019 13:21
Show Gist options
  • Save kennir/8f08ecdfa8d8bc965b2624041cbacab9 to your computer and use it in GitHub Desktop.
Save kennir/8f08ecdfa8d8bc965b2624041cbacab9 to your computer and use it in GitHub Desktop.
合并数组并且移除重复项
var c = array1.concat(array2.filter(function(i) {
return array1.indexOf(i) == -1;
}));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment