New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

for-each-plus

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

for-each-plus

A better forEach.

  • 1.0.6
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
decreased by-100%
Maintainers
1
Weekly downloads
 
Created
Source

for-each-plus Build Status

A better forEach.

Iterates over a list of elements, yielding each in turn to an iteratee function.

Inspired by _.forEach. 😄

Install

Install with npm

$ npm install for-each-plus

Or unpkg

<script src="https://unpkg.com/for-each-plus@1.0.3/umd/index.js" />

Check out the unit tests on CodePen.

Usage

Iterates over a list of elements, yielding each in turn to an iteratee function. The iteratee is bound to the context object, if one is passed. Each invocation of iteratee is called with three arguments: (element, index, list). If list is a JavaScript object, iteratee's arguments will be (value, key, list). Returns the list for chaining.

const forEach = require('for-each-plus');

forEach([1, 2], value => console.log(value));
// => Logs `1` then `2`.
 
forEach({ 'a': 1, 'b': 2 }, (value, key) => console.log(key));
// => Logs 'a' then 'b' (iteration order is not guaranteed).

Like us a lot? Help others know why you like us! Review this package on pkgreview.devReview us on pkgreview.dev

API

forEach(list, iteratee, [context])

list

Type: array or object
Default: none

The collection of elements to iterate over.

iteratee

Type: function
Default: none

Function to apply.

License

MIT

Keywords

FAQs

Package last updated on 23 Mar 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc