main
Last change
on this file since d565449 was d565449, checked in by stefan toskovski <stefantoska84@…>, 4 weeks ago |
Update repo after prototype presentation
|
-
Property mode
set to
100644
|
File size:
864 bytes
|
Rev | Line | |
---|
[d565449] | 1 | import baseForOwnRight from './_baseForOwnRight.js';
|
---|
| 2 | import castFunction from './_castFunction.js';
|
---|
| 3 |
|
---|
| 4 | /**
|
---|
| 5 | * This method is like `_.forOwn` except that it iterates over properties of
|
---|
| 6 | * `object` in the opposite order.
|
---|
| 7 | *
|
---|
| 8 | * @static
|
---|
| 9 | * @memberOf _
|
---|
| 10 | * @since 2.0.0
|
---|
| 11 | * @category Object
|
---|
| 12 | * @param {Object} object The object to iterate over.
|
---|
| 13 | * @param {Function} [iteratee=_.identity] The function invoked per iteration.
|
---|
| 14 | * @returns {Object} Returns `object`.
|
---|
| 15 | * @see _.forOwn
|
---|
| 16 | * @example
|
---|
| 17 | *
|
---|
| 18 | * function Foo() {
|
---|
| 19 | * this.a = 1;
|
---|
| 20 | * this.b = 2;
|
---|
| 21 | * }
|
---|
| 22 | *
|
---|
| 23 | * Foo.prototype.c = 3;
|
---|
| 24 | *
|
---|
| 25 | * _.forOwnRight(new Foo, function(value, key) {
|
---|
| 26 | * console.log(key);
|
---|
| 27 | * });
|
---|
| 28 | * // => Logs 'b' then 'a' assuming `_.forOwn` logs 'a' then 'b'.
|
---|
| 29 | */
|
---|
| 30 | function forOwnRight(object, iteratee) {
|
---|
| 31 | return object && baseForOwnRight(object, castFunction(iteratee));
|
---|
| 32 | }
|
---|
| 33 |
|
---|
| 34 | export default forOwnRight;
|
---|
Note:
See
TracBrowser
for help on using the repository browser.