Skip to content

Instantly share code, notes, and snippets.

@indiejoseph
Last active August 29, 2015 14:01
Show Gist options
  • Select an option

  • Save indiejoseph/b3a6da62a1b4647c9a8f to your computer and use it in GitHub Desktop.

Select an option

Save indiejoseph/b3a6da62a1b4647c9a8f to your computer and use it in GitHub Desktop.
Sort object by value
obj = do (obj) ->
res = {}
keys = Object.keys(obj).sort (a, b) -> obj[b] - obj[a]
res[name] = obj[name] for name in keys
res
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment