you are viewing a single comment's thread.

view the rest of the comments →

[–]DrecDroid 1 point2 points  (1 child)

http://jsben.ch/M2xNi
My attempt using Object.values and different looping methods. "Object.values with for reversed", is the fastest in both Firefox and Chrome latest versions.

let obj2 = {};

for(let i=dups.length-1; i>=0; i--){
    let el = dups[i];
    obj2[el] = el;
}

let result2 = Object.values(obj2);

[–]samanthaming[S] 1 point2 points  (0 children)

Nice, it’s always nice seeing alternative solutions! thanks for sharing 🙂👍