Defining an array of anonymous objects in CoffeeScript
You can also add a coma between each object:
items:[
item1:
name1:value1
,
item2:
name:value2
]
Simple -- place a comma by itself in a column lower than that in which you define your objects.
a = [
nameA1: valueA1
nameA2: valueA2
nameA3: valueA3
,
nameB1: valueB1
nameB2: valueB2
nameB3: valueB3
]
Will become:
var a;
a = [
{
nameA1: valueA1,
nameA2: valueA2,
nameA3: valueA3
}, {
nameB1: valueB1,
nameB2: valueB2,
nameB3: valueB3
}
];