Array.uniq does not work in Prototype

For arrays of objects, uniq does not work as expected, since it uses strict equality. So

[[1], [1]].uniq() == [[1], [1]]

In some cases, this might be a workaround:

[[1], [1]].invoke("toJSON").uniq().invoke("evalJSON")   
// == [[1]]
Tobias Kraze Over 13 years ago