Skip to content

Instantly share code, notes, and snippets.

@AlexeyNik
Created July 29, 2020 07:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AlexeyNik/cb6812587999a33c046d070e52e00ad8 to your computer and use it in GitHub Desktop.
Save AlexeyNik/cb6812587999a33c046d070e52e00ad8 to your computer and use it in GitHub Desktop.
// Удаляем повторяющиеся элементы в массиве
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