@amphibian/for-own

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

Stats

StarsIssuesVersionUpdatedCreatedSize
@amphibian/for-own
1.0.145 years ago6 years agoMinified + gzip package size for @amphibian/for-own in KB

Readme

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

If you find any bugs or have a feature request, please open an issue on github!

The npm package download data comes from npm's download counts api and package details come from npms.io.