-
-
Save basekays/56e4ae12a9f0c0233ef12cf43ff8f43b to your computer and use it in GitHub Desktop.
-
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| _.each = function(collection, iterator) { | |
| if (Array.isArray(collection)) { | |
| for (var i = 0; i<collection.length; i++) { | |
| return iterator(collection[i], i, collection); | |
| } | |
| } else { | |
| for (var i in collection) { | |
| return iterator(collection[i]); | |
| } | |
| } | |
| } | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment