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
### Keybase proof | |
I hereby claim: | |
* I am charmedsatyr on github. | |
* I am charmedsatyr (https://keybase.io/charmedsatyr) on keybase. | |
* I have a public key ASAlfvhXnBEtxQECzQFYUMWRhL0wUBV1pvNmsRA9UXuMiAo | |
To claim this, I am signing this object: |
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
// METHOD 1: reduce/indexOf | |
//`uniques` contains one of each unique value in `arr` | |
let arr = ['ant', 0, 'aunt', 'ant']; | |
let uniques = arr.reduce((acc, curr) => { | |
if (acc.indexOf(curr) < 0) { | |
acc.push(curr); | |
} | |
return acc; | |
}, []); |
NewerOlder