update docs

This commit is contained in:
rolux 2012-05-23 17:43:32 +02:00
parent 65fd7d4dd0
commit 9137607045

View file

@ -149,6 +149,7 @@ Ox.find = function(arr, str) {
}; };
/*@ /*@
// FIXME: documentation is outdated!
Ox.forEach <f> forEach loop Ox.forEach <f> forEach loop
<code>Ox.forEach()</code> loops over arrays, objects and strings. <code>Ox.forEach()</code> loops over arrays, objects and strings.
Returning <code>false</code> from the iterator function acts like a Returning <code>false</code> from the iterator function acts like a
@ -159,7 +160,7 @@ Ox.forEach <f> forEach loop
(collection, callback) <a|o|s> The collection (collection, callback) <a|o|s> The collection
(collection, callback, includePrototype) <a|o|s> The collection (collection, callback, includePrototype) <a|o|s> The collection
collection <a|o|s> An array, object or string collection <a|o|s> An array, object or string
callback <f> Callback function callback <f> Iterator function
value <*> Value value <*> Value
key <n|s> Key key <n|s> Key
includePrototype <b|false> If true, include prototype properties includePrototype <b|false> If true, include prototype properties
@ -456,8 +457,8 @@ Ox.map <f> Transforms the values of an array, object or string
[true, false, false] [true, false, false]
> Ox.map({a: 'a', b: 'a', c: 'a'}, function(v, k) { return v == k; }) > Ox.map({a: 'a', b: 'a', c: 'a'}, function(v, k) { return v == k; })
{a: true, b: false, c: false} {a: true, b: false, c: false}
> Ox.map("000", function(v, i) { return v == i; }) > Ox.map('foo', function(v) { return v.toUpperCase(); })
[true, false, false] 'FOO'
> Ox.map([0, 1, 2, 4], function(v, i) { return v ? i == v : null; }) > Ox.map([0, 1, 2, 4], function(v, i) { return v ? i == v : null; })
[true, true, false] [true, true, false]
> Ox.map([,], function(v, i) { return i; }) > Ox.map([,], function(v, i) { return i; })