I need to incorporate an index in my array:
Here is the loop I am using:
for(j=0; j< data.data.tickets.length; j++) {
var created_at = data.data.tickets[j].created_at;
var tickettitle = data.data.tickets[j].subject;
cleartab[requesterid]['tickets'] = [{"created":created_at, "titre":tickettitle}];
}
The resulting array is presented here: https://i.sstatic.net/SlvRF.png
The issue lies in the fact that the key in tickets[]
keeps getting overwritten, preventing proper iteration. My users have multiple tickets, each represented by an index with a date and title.