File: .verb.md

package info (click to toggle)
node-for-in 1.0.2-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, sid
  • size: 116 kB
  • sloc: sh: 11; makefile: 6
file content (20 lines) | stat: -rw-r--r-- 306 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
## Usage

```js
var forIn = require('{%= name %}');

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'];
```