Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
JavaScript implementation of function for removing duplicate items from array
function removeDuplicates(vals) {
var res = [];
var tmp = vals.sort();
for (var i = 0; i < tmp.length; i++) {
while (JSON.stringify(tmp[i]) == JSON.stringify(tmp[i + 1])) {
return res;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment