I want to create an array from a loop which gets data from DB using AJAX. This is an example of the data:
events : [
{
id : 999,
title : 'Anglais Mr Azhar 2A',
start : '2015-12-08T14:30:00',
end : '2015-12-07T16:30:00'
},
{
id : 999,
title : 'ERP 1B',
start : '2015-12-08T16:45:00',
end : '2015-12-08T18:15:00'
},
{
id : 999,
title : 'PMC Mr Belasla 3A',
start : '2015-12-07T08:30:00',
end : '2015-12-07T10:00:00'
},
]
I want to assign the array created in the loop to events not like in this example where it is done manually.
So how can I create an Array from this data--id, title, start, ...-- to set events? Something like this:
events=myArray