Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/twada/array-foreach
Array#forEach ponyfill for older browsers
https://github.com/twada/array-foreach
Last synced: 3 months ago
JSON representation
Array#forEach ponyfill for older browsers
- Host: GitHub
- URL: https://github.com/twada/array-foreach
- Owner: twada
- License: mit
- Created: 2015-03-04T07:11:02.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2016-10-01T09:10:13.000Z (over 8 years ago)
- Last Synced: 2024-05-12T06:01:05.293Z (8 months ago)
- Language: JavaScript
- Size: 12.7 KB
- Stars: 8
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: MIT-LICENSE
Awesome Lists containing this project
- awesome-ponyfills - array-foreach - [`Array.prototype.forEach`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/forEach) (Arrays)
README
array-foreach
================================[![Build Status][travis-image]][travis-url]
[![NPM package][npm-image]][npm-url]
[![Bower package][bower-image]][bower-url]
[![Dependency Status][depstat-image]][depstat-url]
[![License][license-image]][license-url]Array#forEach [ponyfill](https://ponyfill.com) for older browsers
DESCRIPTION
---------------------------------------Provides `forEach` function for older browsers, use native implememtation if exists.
It's just like
- [array-map](https://www.npmjs.org/package/array-map)
- [array-filter](https://www.npmjs.org/package/array-filter)
- [array-some](https://www.npmjs.org/package/array-some)
- [array-reduce](https://www.npmjs.org/package/array-reduce)
- [indexof](https://www.npmjs.org/package/indexof)
- [object-assign](https://www.npmjs.com/package/object-assign)EXAMPLE
---------------------------------------```javascript
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
```javascript
var forEach = require('array-foreach');
```### via bower
Install
$ bower install --save array-foreach
Load (`forEach` function is exported)
Use
```javascript
var result = '';
forEach(['foo', 'bar', 'baz'], function (element, index, array) {
result += element;
});
```AUTHOR
---------------------------------------
* [Takuto Wada](http://github.com/twada)LICENSE
---------------------------------------
Licensed under the [MIT](https://github.com/twada/array-foreach/blob/master/MIT-LICENSE) license.[travis-url]: http://travis-ci.org/twada/array-foreach
[travis-image]: https://secure.travis-ci.org/twada/array-foreach.svg?branch=master[npm-url]: https://npmjs.org/package/array-foreach
[npm-image]: https://badge.fury.io/js/array-foreach.svg[bower-url]: http://badge.fury.io/bo/array-foreach
[bower-image]: https://badge.fury.io/bo/array-foreach.svg[depstat-url]: https://gemnasium.com/twada/array-foreach
[depstat-image]: https://gemnasium.com/twada/array-foreach.svg[license-url]: https://github.com/twada/array-foreach/blob/master/MIT-LICENSE
[license-image]: http://img.shields.io/badge/license-MIT-brightgreen.svg