Introducing Socket Firewall: Free, Proactive Protection for Your Software Supply Chain.Learn More
Socket
Book a DemoInstallSign in
Socket

@amphibian/for-own

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@amphibian/for-own

for...in abstraction to iterate over an objects own keys

latest
Source
npmnpm
Version
1.0.14
Version published
Maintainers
1
Created
Source

for-own

build status

for...in abstraction to iterate over an objects own keys

npm install @amphibian/for-own
var forOwn = require('@amphibian/for-own');
var object = {
    foo: 'bar',
    bar: 'foo'
};

// Iterate over object keys and values
forOwn(object, function (key, value) {
    console.log(key, value);
});

// Iterate over object keys, but stop if the key is `foo`
var question = forOwn(object, function (key, value, end) {
    console.log(key, value);

    if (key === 'foo') {
        end('hola que hora es');
    }
});

console.log(question); // > hola que hora es

FAQs

Package last updated on 28 Jan 2017

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