mirror of
https://github.com/mgerb/mywebsite
synced 2026-01-12 10:52:47 +00:00
1.0 KiB
1.0 KiB
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:
npm i for-in --save
Run tests
npm test
Usage
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
License
Copyright (c) 2014 Jon Schlinkert, contributors. Released under the MIT license
This file was generated by verb-cli on September 20, 2014.