-
-
Save mkv27/87c412b444f0368c5abc040258b596b1 to your computer and use it in GitHub Desktop.
merge two arrays and remove duplicate in es6
This file contains 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
let arr1 = [3, 5, 2, 2, 5, 5]; | |
let arr2 = [2, 1, 66, 5]; | |
let unique = [...new Set([...arr1,...arr2])]; | |
console.log(unique); | |
// [ 3, 5, 2, 1, 66 ] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment