| 1358 | // Handles raw objects in addition to array-likes. Treats all |
| 1359 | // sparse array-likes as if they were dense. |
| 1360 | function each(obj, iteratee, context) { |
| 1361 | iteratee = optimizeCb(iteratee, context); |
| 1362 | var i, length; |
| 1363 | if (isArrayLike(obj)) { |
| 1364 | for (i = 0, length = obj.length; i < length; i++) { |
| 1365 | iteratee(obj[i], i, obj); |
| 1366 | } |
| 1367 | } else { |
| 1368 | var _keys = keys(obj); |
| 1369 | for (i = 0, length = _keys.length; i < length; i++) { |
| 1370 | iteratee(obj[_keys[i]], _keys[i], obj); |
| 1371 | } |
| 1372 | } |
| 1373 | return obj; |
| 1374 | } |
| 1375 | |
| 1376 | // Return the results of applying the iteratee to each element. |
| 1377 | function map(obj, iteratee, context) { |