Skip to content

Instantly share code, notes, and snippets.

@TiagoNunesDeveloper
Created October 6, 2017 14:22
Show Gist options
  • Save TiagoNunesDeveloper/44aa437af7b0a330d3a33a332efd6e98 to your computer and use it in GitHub Desktop.
Save TiagoNunesDeveloper/44aa437af7b0a330d3a33a332efd6e98 to your computer and use it in GitHub Desktop.
concat filter
var arr1 = [1, 2, 3]
var arr2 = [1, 3, 5]
var arr3 = arr1.concat(arr2).filter(function (item, index, array) {
return array.indexOf(item) === index
})
console.log(arr3) // [1, 2, 3, 5]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment