Array#forEach ponyfill for older browsers
Provides forEach
function for older browsers, use native implememtation if exists.
It's just like
var forEach = require('array-foreach');
var result = '';
forEach(['foo', 'bar', 'baz'], function (element, index, array) {
result += element;
});
console.log(result); // 'foobarbaz'
Install
$ npm install --save array-foreach
Use
var forEach = require('array-foreach');
Install
$ bower install --save array-foreach
Load (forEach
function is exported)
<script type="text/javascript" src="./path/to/bower_components/array-foreach/build/array-foreach.js"></script>
Use
var result = '';
forEach(['foo', 'bar', 'baz'], function (element, index, array) {
result += element;
});
Licensed under the MIT license.