1 | # for-in [![NPM version](https://badge.fury.io/js/for-in.svg)](http://badge.fury.io/js/for-in)
|
2 |
|
3 | > 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
|
4 |
|
5 | ## Install
|
6 | #### Install with [npm](npmjs.org):
|
7 |
|
8 | ```bash
|
9 | npm i for-in --save
|
10 | ```
|
11 |
|
12 | ## Run tests
|
13 |
|
14 | ```bash
|
15 | npm test
|
16 | ```
|
17 |
|
18 | ## Usage
|
19 |
|
20 | ```js
|
21 | var forIn = require('for-in');
|
22 |
|
23 | var obj = {a: 'foo', b: 'bar', c: 'baz'};
|
24 | var values = [];
|
25 | var keys = [];
|
26 |
|
27 | forIn(obj, function (value, key, o) {
|
28 | keys.push(key);
|
29 | values.push(value);
|
30 | });
|
31 |
|
32 | console.log(keys);
|
33 | //=> ['a', 'b', 'c'];
|
34 |
|
35 | console.log(values);
|
36 | //=> ['foo', 'bar', 'baz'];
|
37 | ```
|
38 |
|
39 | ## Author
|
40 |
|
41 | **Jon Schlinkert**
|
42 |
|
43 | + [github/jonschlinkert](https://github.com/jonschlinkert)
|
44 | + [twitter/jonschlinkert](http://twitter.com/jonschlinkert)
|
45 |
|
46 | ## License
|
47 | Copyright (c) 2014 Jon Schlinkert, contributors.
|
48 | Released under the MIT license
|
49 |
|
50 | ***
|
51 |
|
52 | _This file was generated by [verb-cli](https://github.com/assemble/verb-cli) on September 20, 2014._ |
\ | No newline at end of file |