MCPcopy
hub / github.com/stemkoski/stemkoski.github.com / forInRight

Function forInRight

MathBox/mathbox-bundle.js:37190–37205  ·  view source on GitHub ↗

* This method is like `_.forIn` except that it iterates over elements * of a `collection` in the opposite order. * * @static * @memberOf _ * @category Objects * @param {Object} object The object to iterate over. * @param {Function} [callback=identity] The function

(object, callback, thisArg)

Source from the content-addressed store, hash-verified

37188 * // => logs 'move', 'y', and 'x' assuming `_.forIn ` logs 'x', 'y', and 'move'
37189 */
37190 function forInRight(object, callback, thisArg) {
37191 var pairs = [];
37192
37193 forIn(object, function(value, key) {
37194 pairs.push(key, value);
37195 });
37196
37197 var length = pairs.length;
37198 callback = baseCreateCallback(callback, thisArg, 3);
37199 while (length--) {
37200 if (callback(pairs[length--], pairs[length], object) === false) {
37201 break;
37202 }
37203 }
37204 return object;
37205 }
37206
37207 /**
37208 * Iterates over own enumerable properties of an object, executing the callback

Callers

nothing calls this directly

Calls 3

forInFunction · 0.85
baseCreateCallbackFunction · 0.85
callbackFunction · 0.70

Tested by

no test coverage detected