MCPcopy Create free account
hub / github.com/microsoft/SandDance / each

Function each

docs/app/js/sanddance-app.js:92521–92532  ·  view source on GitHub ↗

* walk objects and arrays * @param {Object} obj * @param {Function} iterator * @param {Object} context

(obj, iterator, context)

Source from the content-addressed store, hash-verified

92519 * @param {Function} iterator
92520 * @param {Object} context
92521 */ function each(obj, iterator, context) {
92522 var i;
92523 if (!obj) return;
92524 if (obj.forEach) obj.forEach(iterator, context);
92525 else if (obj.length !== undefined) {
92526 i = 0;
92527 while(i < obj.length){
92528 iterator.call(context, obj[i], i, obj);
92529 i++;
92530 }
92531 } else for(i in obj)obj.hasOwnProperty(i) && iterator.call(context, obj[i], i, obj);
92532 }
92533 /**
92534 * wrap a method with a deprecation warning and stack trace
92535 * @param {Function} method

Callers 6

invokeArrayArgFunction · 0.70
addEventListenersFunction · 0.70
removeEventListenersFunction · 0.70
sanddance-app.jsFile · 0.70
ManagerFunction · 0.70
toggleCssPropsFunction · 0.70

Calls 1

forEachMethod · 0.45

Tested by

no test coverage detected