basant307/AI_Governance_Project
045
1var baseForRight = require('./_baseForRight'),2 castFunction = require('./_castFunction'),3 keysIn = require('./keysIn');4 5/**6 * This method is like `_.forIn` except that it iterates over properties of7 * `object` in the opposite order.8 *9 * @static10 * @memberOf _11 * @since 2.0.012 * @category Object13 * @param {Object} object The object to iterate over.14 * @param {Function} [iteratee=_.identity] The function invoked per iteration.15 * @returns {Object} Returns `object`.16 * @see _.forIn17 * @example18 *19 * function Foo() {20 * this.a = 1;21 * this.b = 2;22 * }23 *24 * Foo.prototype.c = 3;25 *26 * _.forInRight(new Foo, function(value, key) {27 * console.log(key);28 * });29 * // => Logs 'c', 'b', then 'a' assuming `_.forIn` logs 'a', 'b', then 'c'.30 */31function forInRight(object, iteratee) {32 return object == null33 ? object34 : baseForRight(object, castFunction(iteratee), keysIn);35}36 37module.exports = forInRight;38 