Sha256: e916754b3408ba06e318e771002ad4085d3dd1a5d48672f4e2f908c0d78c611b
Contents?: true
Size: 1.04 KB
Versions: 16
Compression:
Stored size: 1.04 KB
Contents
# for-in [![NPM version](https://badge.fury.io/js/for-in.svg)](http://badge.fury.io/js/for-in) > Iterate over the own and inherited enumerable properties of an objecte, and return an object with properties that evaluate to true from the callback. Exit early by returning `false`. JavaScript/Node.js ## Install #### Install with [npm](npmjs.org): ```bash npm i for-in --save ``` ## Run tests ```bash npm test ``` ## Usage ```js var forIn = require('for-in'); var obj = {a: 'foo', b: 'bar', c: 'baz'}; var values = []; var keys = []; forIn(obj, function (value, key, o) { keys.push(key); values.push(value); }); console.log(keys); //=> ['a', 'b', 'c']; console.log(values); //=> ['foo', 'bar', 'baz']; ``` ## Author **Jon Schlinkert** + [github/jonschlinkert](https://github.com/jonschlinkert) + [twitter/jonschlinkert](http://twitter.com/jonschlinkert) ## License Copyright (c) 2014 Jon Schlinkert, contributors. Released under the MIT license *** _This file was generated by [verb-cli](https://github.com/assemble/verb-cli) on September 20, 2014._
Version data entries
16 entries across 16 versions & 3 rubygems