mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-09 18:37:50 +00:00
Bump to v4.7.0.
This commit is contained in:
13
forOwn.js
13
forOwn.js
@@ -1,14 +1,15 @@
|
||||
var baseCastFunction = require('./_baseCastFunction'),
|
||||
baseForOwn = require('./_baseForOwn');
|
||||
var baseForOwn = require('./_baseForOwn'),
|
||||
baseIteratee = require('./_baseIteratee');
|
||||
|
||||
/**
|
||||
* Iterates over own enumerable properties of an object invoking `iteratee`
|
||||
* for each property. The iteratee is invoked with three arguments:
|
||||
* Iterates over own enumerable string keyed properties of an object invoking
|
||||
* `iteratee` for each property. The iteratee is invoked with three arguments:
|
||||
* (value, key, object). Iteratee functions may exit iteration early by
|
||||
* explicitly returning `false`.
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
* @since 0.3.0
|
||||
* @category Object
|
||||
* @param {Object} object The object to iterate over.
|
||||
* @param {Function} [iteratee=_.identity] The function invoked per iteration.
|
||||
@@ -25,10 +26,10 @@ var baseCastFunction = require('./_baseCastFunction'),
|
||||
* _.forOwn(new Foo, function(value, key) {
|
||||
* console.log(key);
|
||||
* });
|
||||
* // => logs 'a' then 'b' (iteration order is not guaranteed)
|
||||
* // => Logs 'a' then 'b' (iteration order is not guaranteed).
|
||||
*/
|
||||
function forOwn(object, iteratee) {
|
||||
return object && baseForOwn(object, baseCastFunction(iteratee));
|
||||
return object && baseForOwn(object, baseIteratee(iteratee));
|
||||
}
|
||||
|
||||
module.exports = forOwn;
|
||||
|
||||
Reference in New Issue
Block a user