diff options
Diffstat (limited to 'node_modules/foreach/Readme.md')
| -rw-r--r-- | node_modules/foreach/Readme.md | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/node_modules/foreach/Readme.md b/node_modules/foreach/Readme.md new file mode 100644 index 00000000..2752b574 --- /dev/null +++ b/node_modules/foreach/Readme.md @@ -0,0 +1,30 @@ + +# foreach + +Iterate over the key value pairs of either an array-like object or a dictionary like object. + +[![browser support][1]][2] + +## API + +### foreach(object, function, [context]) + +```js +var each = require('foreach'); + +each([1,2,3], function (value, key, array) { + // value === 1, 2, 3 + // key === 0, 1, 2 + // array === [1, 2, 3] +}); + +each({0:1,1:2,2:3}, function (value, key, object) { + // value === 1, 2, 3 + // key === 0, 1, 2 + // object === {0:1,1:2,2:3} +}); +``` + +[1]: https://ci.testling.com/manuelstofer/foreach.png +[2]: https://ci.testling.com/manuelstofer/foreach + |
