array-foreach

Array#forEach ponyfill for older browsers

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
array-foreach
801.0.27 years ago8 years agoMinified + gzip package size for array-foreach in KB

Readme

array-foreach
!Build Statustravis-imagetravis-url !NPM packagenpm-imagenpm-url !Bower packagebower-imagebower-url !Dependency Statusdepstat-imagedepstat-url !Licenselicense-imagelicense-url
Array#forEach ponyfill for older browsers
Ponyfill: A polyfill that doesn't overwrite the native method

DESCRIPTION

Provides forEach function for older browsers, use native implememtation if exists.
It's just like

EXAMPLE

var forEach = require('array-foreach');
var result = '';
forEach(['foo', 'bar', 'baz'], function (element, index, array) {
    result += element;
});
console.log(result); // 'foobarbaz'

INSTALL

via npm

Install
$ npm install --save array-foreach
Use
var forEach = require('array-foreach');

via bower

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;
});

AUTHOR

LICENSE

Licensed under the MIT license.