Created
January 9, 2014 21:34
-
-
Save ondrek/8342481 to your computer and use it in GitHub Desktop.
Remove from array all repeated items and return only uniq values in 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
var _getUniqItemsFromArray = function(array){ | |
var temp = {}; | |
var uniqueArray = []; | |
for (var i = 0; i < array.length; i++) { | |
temp[array[i]] = true; | |
} | |
for (var k in temp) { | |
uniqueArray.push(k); | |
} | |
return uniqueArray; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment