Skip to content

Instantly share code, notes, and snippets.

@stephenhandley
Created March 29, 2012 08:47
Show Gist options
  • Save stephenhandley/2235099 to your computer and use it in GitHub Desktop.
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
__.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