Socket
Socket
Sign inDemoInstall

lodash.forown

Package Overview
Dependencies
3
Maintainers
4
Versions
18
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

lodash.forown


Version published
Maintainers
4
Created

Package description

What is lodash.forown?

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.

What are lodash.forown's main functionalities?

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);
});

Other packages similar to lodash.forown

Readme

Source

lodash.forown v2.1.0

The Lo-Dash function _.forOwn as a Node.js module generated by lodash-cli.

Dive in

There’s plenty of documentation, unit tests, & benchmarks.

Support

lodash.forown has been tested in at least Node.js 0.6.8-0.10.18.

Author

twitter/jdalton
John-David Dalton

Contributors

twitter/blainebublitztwitter/kitcambridgetwitter/mathias
Blaine BublitzKit CambridgeMathias Bynens

Keywords

FAQs

Last updated on 23 Sep 2013

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

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc