From 91376070453c6e9d558e093019b4ecf03872430b Mon Sep 17 00:00:00 2001 From: rolux Date: Wed, 23 May 2012 17:43:32 +0200 Subject: [PATCH] update docs --- source/Ox/js/Collection.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/source/Ox/js/Collection.js b/source/Ox/js/Collection.js index 8996dd17..70b9a873 100644 --- a/source/Ox/js/Collection.js +++ b/source/Ox/js/Collection.js @@ -149,6 +149,7 @@ Ox.find = function(arr, str) { }; /*@ +// FIXME: documentation is outdated! Ox.forEach forEach loop Ox.forEach() loops over arrays, objects and strings. Returning false from the iterator function acts like a @@ -159,7 +160,7 @@ Ox.forEach forEach loop (collection, callback) The collection (collection, callback, includePrototype) The collection collection An array, object or string - callback Callback function + callback Iterator function value <*> Value key Key includePrototype If true, include prototype properties @@ -456,8 +457,8 @@ Ox.map Transforms the values of an array, object or string [true, false, false] > Ox.map({a: 'a', b: 'a', c: 'a'}, function(v, k) { return v == k; }) {a: true, b: false, c: false} - > Ox.map("000", function(v, i) { return v == i; }) - [true, false, false] + > Ox.map('foo', function(v) { return v.toUpperCase(); }) + 'FOO' > Ox.map([0, 1, 2, 4], function(v, i) { return v ? i == v : null; }) [true, true, false] > Ox.map([,], function(v, i) { return i; })