MCPcopy Create free account
hub / github.com/EricSimons/ionic-course / each

Function each

code/songhop/www/lib/platform/platform.js:131–142  ·  view source on GitHub ↗

* An iteration utility for arrays and objects. * * @private * @param {Array|Object} object The object to iterate over. * @param {Function} callback The function called per iteration.

(object, callback)

Source from the content-addressed store, hash-verified

129 * @param {Function} callback The function called per iteration.
130 */
131 function each(object, callback) {
132 var index = -1,
133 length = object ? object.length : 0;
134
135 if (typeof length == 'number' && length > -1 && length <= maxSafeInteger) {
136 while (++index < length) {
137 callback(object[index], index, object);
138 }
139 } else {
140 forOwn(object, callback);
141 }
142 }
143
144 /**
145 * Trim and conditionally capitalize string values.

Callers 1

reduceFunction · 0.85

Calls 2

forOwnFunction · 0.85
callbackFunction · 0.50

Tested by

no test coverage detected