Registry / lodash._arrayeach

lodash._arrayeach

JSON →
library3.0.0jsnpmunverified

This package exports the internal `arrayEach` utility function from the Lodash library, specifically corresponding to `lodash` version 3.0.0, released around 2015. `arrayEach` is a foundational, optimized internal method for iterating over arrays. It differs from the public `_.forEach` in that it is strictly for arrays and doesn't handle objects or other collections. As an internal module, its primary purpose was to be consumed by other Lodash functions. While the main `lodash` library continues active development, this specific `lodash._arrayeach` module is considered a snapshot from the v3 era and has not received independent updates since its initial v3 release. Users seeking modern, maintained iteration utilities should rely on the comprehensive `lodash` package (currently v4.x) or `lodash-es` for tree-shakable builds.

npm install lodash._arrayeach
INSTALL
IMPORT
SIG · LODASH._ARRAYEACH
L
lodash._arrayeach
javascriptv3.0.0
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

arrayEach
const arrayEach = require('lodash._arrayeach');
import { arrayEach } from 'lodash._arrayeach';
This package is a CommonJS module from Lodash v3. It does not support ES module imports directly. Attempting to use named imports will result in a TypeError.

Demonstrates how to import and use the internal `arrayEach` function to iterate over an array.

const arrayEach = require('lodash._arrayeach'); const numbers = [10, 20, 30, 40, 50]; const doubledNumbers = []; console.log('Original numbers:', numbers); arrayEach(numbers, (value, index) => { doubledNumbers[index] = value * 2; }); console.log('Doubled numbers:', doubledNumbers); // Demonstrating the internal nature: it's not the public _.forEach const sparseArray = [1, , 3]; // eslint-disable-line no-sparse-arrays const resultSparse = []; arrayEach(sparseArray, (value) => resultSparse.push(value === undefined ? 'undefined' : value)); console.log('ArrayEach on sparse array (handles undefined):', resultSparse);
Debug
Known issues
breakingThis `lodash._arrayeach` package is based on Lodash v3.0.0. The main `lodash` library moved to v4.0.0 in 2015, which introduced significant backward-incompatible changes across the entire library. Using this v3 internal module alongside a modern v4+ `lodash` installation may lead to inconsistent behavior or conflicts due to differing internal implementations.
fix
Migrate to `_.forEach` from a current `lodash` package (v4.x) or `lodash-es` for tree-shakable builds. Avoid direct usage of internal modules like `lodash._arrayeach`.
affects: >=3.0.0 (in context of Lodash v4+ projects)
deprecatedThis package is an abandoned internal module from Lodash v3.0.0 and has not received updates since its initial release. Modern Lodash (v4.x) provides similar or improved functionality through its public API (e.g., `_.forEach` for array iteration) and `lodash-es` for modular, tree-shakable builds, which are actively maintained.
fix
Refactor code to use `_.forEach` directly from the main `lodash` package or `lodash-es`. For example: `import { forEach } from 'lodash'; forEach(array, callback);`
affects: >=3.0.0
gotchaRelying on internal modules like `lodash._arrayeach` is discouraged as they are not part of Lodash's stable public API. Their behavior, existence, and compatibility can change without warning across major versions of the main `lodash` library, leading to unexpected issues during upgrades.
fix
Always use public API functions provided by the main `lodash` package. For array iteration, `_.forEach` is the robust and supported choice.
affects: >=3.0.0
gotchaUsing older versions of any library, including `lodash` and its internal modules from v3, means foregoing security patches and bug fixes. For example, `lodash` v4.18.0 fixed prototype pollution vulnerabilities in `_.unset` and `_.omit` (GHSA-f23m-r3pf-42rh) which would not be present in a v3 codebase.
fix
Upgrade to the latest stable version of the main `lodash` package (v4.x) to benefit from continuous security maintenance and bug fixes. Avoid using outdated internal modules.
affects: >=3.0.0 (all 3.x versions)
Errors
Common errors & fixes
TypeError: Cannot read properties of undefined (reading 'call') at Function.arrayEach
Attempting to call `arrayEach` with a non-array or null/undefined `collection` argument.
fix
Ensure the first argument passed to `arrayEach` is always an array. Example: `arrayEach([], callback);`
TypeError: arrayEach is not a function
Incorrectly trying to import `arrayEach` using ES module syntax or destructuring from the CommonJS package.
fix
Use the correct CommonJS `require` syntax: `const arrayEach = require('lodash._arrayeach');`
Error: Cannot find module 'lodash._arrayeach'
The package `lodash._arrayeach` has not been installed or is not resolvable in the current environment.
fix
Install the package via npm: `npm install --save lodash._arrayeach`
Upgrade
Version history
3.0.0latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
2 hits · last 30 days
node
2
Resources
lodash._arrayeach — npm install lodash._arrayeach · libregistry