How do I create an array of anonymous objects with the least number of characters with coffeescript?
Here's how little I've got it down to (works):
cast:
[ {name: 'Rob Jr.', character: 'Tony Stark'}
{name: 'Sam Jackson', character: 'Nick Fury'}
{name: 'Daniel Craig', character: 'James Bond'} ]
I was hoping to be able to do this:
cast:
[ name: 'Rob Jr.', character: 'Tony Stark'
name: 'Sam Jackson', character: 'Nick Fury'
name: 'Daniel Craig', character: 'James Bond' ]
However I get the error:
SyntaxError: [stdin]:20:9: unexpected :
It gets confused by the first colon it encounters. Is there some coffeescript magic I'm missing?