Created
July 29, 2020 07:29
-
-
Save AlexeyNik/cb6812587999a33c046d070e52e00ad8 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