Created
July 29, 2020 07:29
-
-
Save AlexeyNik/ab481fda98d436397f08161968f7a970 to your computer and use it in GitHub Desktop.
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
// Удаляем повторяющиеся элементы в массиве | |
function unique(aa) { | |
var a = [], | |
o = {}, | |
n = aa.length; | |
for (var i = 0; i < n; ++i) { | |
o[aa[i]] = aa[i]; | |
} | |
for (var i in o) { | |
a.push(o[i]); | |
} | |
return a; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment