forOwnRight.js 844 B

12345678910111213141516171819202122232425262728293031
  1. var baseForOwnRight = require('../internal/baseForOwnRight'),
  2. createForOwn = require('../internal/createForOwn');
  3. /**
  4. * This method is like `_.forOwn` except that it iterates over properties of
  5. * `object` in the opposite order.
  6. *
  7. * @static
  8. * @memberOf _
  9. * @category Object
  10. * @param {Object} object The object to iterate over.
  11. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  12. * @param {*} [thisArg] The `this` binding of `iteratee`.
  13. * @returns {Object} Returns `object`.
  14. * @example
  15. *
  16. * function Foo() {
  17. * this.a = 1;
  18. * this.b = 2;
  19. * }
  20. *
  21. * Foo.prototype.c = 3;
  22. *
  23. * _.forOwnRight(new Foo, function(value, key) {
  24. * console.log(key);
  25. * });
  26. * // => logs 'b' and 'a' assuming `_.forOwn` logs 'a' and 'b'
  27. */
  28. var forOwnRight = createForOwn(baseForOwnRight);
  29. module.exports = forOwnRight;