如何创建以下格式的数组:
var options =
[
{
title: 'Laziness',
start: new Date(y, m, d, 12, 0),
allDay: false
},
{
title: 'Dizziness,Sleepiness',
start: new Date(y, m, d+1, 19, 0),
allDay: false
},
{
title: 'Click for Google',
start: new Date(y, m, 28),
url: 'http://google.com/'
}
];
我试过这样:
for(var i in data)
{
options = {
title:data[i].eventNames,
start:data[i].eventDates
};
}
但它没有以正确的格式显示,我该如何实现