Created
July 14, 2017 16:39
-
-
Save rtmalone/27463f1d2f47bc5333948c89e37b7dd6 to your computer and use it in GitHub Desktop.
Deduplicate Array
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
| // Filters duplicates from an array of Primitives (String, Bool, Num, null, undefined, Symbol) | |
| const returnedArray = array | |
| .map(obj => obj.name) | |
| .filter((elem, idx, arr) => arr.indexOf(elem) === idx); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment