uniq :: Array |
Example
['Sam', 'Justin', 'Andrew', 'Dan', 'Sam'].uniq(); // -> ['Sam', 'Justin', 'Andrew', 'Dan']
['Prototype', 'prototype'].uniq(); // -> ['Prototype', 'prototype'] because String comparison is case-sensitive
Performance considerations
On large arrays with duplicates, this method has a potentially large performance cost:
More efficient implementations could be devised. This page will get updated if such an optimization is committed. |
Prototype API 1.5.0 - prototypejs.org