Skip to content

Instantly share code, notes, and snippets.

@Arwid
Created September 1, 2011 07:47
Show Gist options
  • Save Arwid/1185661 to your computer and use it in GitHub Desktop.
Save Arwid/1185661 to your computer and use it in GitHub Desktop.
Nifty way of creating an array of objects
config = _.map [
[1, "Important", "Urgent"]
[2, "Important", "Not Urgent"]
[3, "Not Important", "Not Urgent"]
[4, "Not Important", "Not Urgent"]
], (x) -> {id:x[0], vtitle:x[1], htitle:x[2]}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment