Last active
March 20, 2020 03:14
-
-
Save kluu1/6ffb2d6841d33c6a834281c4a9cac93f to your computer and use it in GitHub Desktop.
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
| const zoo = ['tiger', 'horse', 'tiger', 'lion', 'snake', 'bear', 'tiger']; | |
| const animals = zoo.filter((animal, index) => animal.indexOf(animal) !== index); | |
| console.log(animals); // ["horse", "tiger", "lion", "snake", "bear", "tiger"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment