Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var each = function(collection, cb) {
- if (isArrayLike(collection)) {
- for (var i = 0; i < collection.length; i++) {
- cb.call(collection[i], i, collection[i]);
- }
- } else {
- for (var prop in collection) {
- cb.call(collection[prop], prop, collection[prop]);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement