Security News
JSR Working Group Kicks Off with Ambitious Roadmap and Plans for Open Governance
At its inaugural meeting, the JSR Working Group outlined plans for an open governance model and a roadmap to enhance JavaScript package management.
lodash.forown
Advanced tools
The Lo-Dash function `_.forOwn` as a Node.js module generated by lodash-cli.
The lodash.forown package is a utility function from the Lodash library that iterates over own enumerable string keyed properties of an object and invokes a function for each property. This is useful for object manipulation and iteration tasks.
Iterate over object properties
This feature allows you to iterate over the own enumerable string keyed properties of an object. The provided function is invoked for each property, receiving the value and key as arguments.
const _ = require('lodash.forown');
const object = { 'a': 1, 'b': 2, 'c': 3 };
_.forOwn(object, function(value, key) {
console.log(key, value);
});
Early exit from iteration
This feature allows you to exit the iteration early by returning `false` from the iteratee function. This can be useful when you need to stop processing once a certain condition is met.
const _ = require('lodash.forown');
const object = { 'a': 1, 'b': 2, 'c': 3 };
_.forOwn(object, function(value, key) {
if (key === 'b') {
return false;
}
console.log(key, value);
});
The object-foreach package provides similar functionality to lodash.forown by iterating over the own properties of an object. It is a lightweight alternative but lacks the extensive utility functions provided by Lodash.
The Lo-Dash function _.forOwn
as a Node.js module generated by lodash-cli.
lodash.forown has been tested in at least Node.js 0.6.8-0.10.18.
John-David Dalton |
Blaine Bublitz | Kit Cambridge | Mathias Bynens |
FAQs
The lodash method `_.forOwn` exported as a module.
The npm package lodash.forown receives a total of 302,199 weekly downloads. As such, lodash.forown popularity was classified as popular.
We found that lodash.forown demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 open source maintainers collaborating on the project.
Did you know?
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.
Security News
At its inaugural meeting, the JSR Working Group outlined plans for an open governance model and a roadmap to enhance JavaScript package management.
Security News
Research
An advanced npm supply chain attack is leveraging Ethereum smart contracts for decentralized, persistent malware control, evading traditional defenses.
Security News
Research
Attackers are impersonating Sindre Sorhus on npm with a fake 'chalk-node' package containing a malicious backdoor to compromise developers' projects.