From a3eaa0401f0439ba46cc02880071b8481d1453bc Mon Sep 17 00:00:00 2001 From: tjcrowder Date: Mon, 7 Sep 2009 13:07:03 +0100 Subject: [PATCH] doc: ported and updated old doc for Array#uniq --- src/lang/array.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/lang/array.js b/src/lang/array.js index c93e8b8..44073f5 100644 --- a/src/lang/array.js +++ b/src/lang/array.js @@ -254,6 +254,17 @@ Array.from = $A; * * Produces a duplicate-free version of an array. If no duplicates are * found, the original array is returned. + * + * On large arrays when `sorted` is `false`, this method has a potentially + * large performance cost. + * + * ### Examples + * + * [1, 3, 2, 1].uniq(); + * // -> [1, 2, 3] + * + * ['A', 'a'].uniq(); + * // -> ['A', 'a'] (because String comparison is case-sensitive) **/ function uniq(sorted) { return this.inject([], function(array, value, index) {