Created
December 23, 2015 14:24
-
-
Save SeanJM/c3a1a198be257ce4346b to your computer and use it in GitHub Desktop.
A function which returns the uniq members of an 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
| function arrayUniq(array) { | |
| var u = []; | |
| array.forEach(function (a) { | |
| if (u.indexOf(a) === -1) { | |
| u.push(a); | |
| } | |
| }); | |
| return u; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment