1. for-each
A better forEach
for-each
Package: for-each
Created by: Raynos
Last modified: Fri, 09 Jun 2023 21:33:08 GMT
Version: 0.3.3
License: MIT
Downloads: 115,212,250
Repository: https://github.com/Raynos/for-each

Install

npm install for-each
yarn add for-each

for-each build status

browser support

A better forEach.

Example

Like Array.prototype.forEach but works on objects.

 var forEach = require("for-each")

forEach({ key: "value" }, function (value, key, object) {
    /* code */
})

As a bonus, it's also a perfectly function shim/polyfill for arrays too!

 var forEach = require("for-each")

forEach([1, 2, 3], function (value, index, array) {
    /* code */
})

Installation

npm install for-each

Contributors

  • Raynos

MIT Licenced

RELATED POST

10 Must-Know Windows Shortcuts That Will Save You Time

10 Must-Know Windows Shortcuts That Will Save You Time

Arrays vs Linked Lists: Which is Better for Memory Management in Data Structures?

Arrays vs Linked Lists: Which is Better for Memory Management in Data Structures?

Navigating AWS Networking: Essential Hacks for Smooth Operation

Navigating AWS Networking: Essential Hacks for Smooth Operation

Achieving Stunning Visuals with Unity's Global Illumination

Achieving Stunning Visuals with Unity's Global Illumination

Nim's Hidden Gems: Lesser-known Features for Writing Efficient Code

Nim's Hidden Gems: Lesser-known Features for Writing Efficient Code