UNPKG

create-expo-cljs-app

Version:

Create a react native application with Expo and Shadow-CLJS!

29 lines (26 loc) 539 B
/** * @private * walk objects and arrays * @param {Object} obj * @param {Function} iterator * @param {Object} context */ export default function each(obj, iterator, context) { let i; if (!obj) { return; } if (obj.forEach) { obj.forEach(iterator, context); } else if (obj.length !== undefined) { i = 0; while (i < obj.length) { iterator.call(context, obj[i], i, obj); i++; } } else { for (i in obj) { obj.hasOwnProperty(i) && iterator.call(context, obj[i], i, obj); } } }