Created
March 29, 2012 08:47
-
-
Save stephenhandley/2235099 to your computer and use it in GitHub Desktop.
is there a better way of doing mapping an iterator across an object
This file contains 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
__.traverse = (obj, iterator, context)-> | |
result = {} | |
return result unless obj | |
for k,v of obj | |
result[k] = iterator.call(context, k, v) | |
result | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment