How do I convert testObj to an array?
function MinEvent(event, width, left){
this.start = event.start;
this.end = event.end;
this.width = width;
this.top = event.start;
this.left = left;
}
var testObj = {};
for (var j=0; j<eventLists.length; j++) {
var eve = eventLists[j];
var event = new MinEvent(eventList[j], width, left);
testObj[eve.id] = event;
}
new Eventis supposed to benew MinEventandeventListsis initialized to something sane).testObjto be a true array, you need to tell us how you want its properties converted. Maybe it would help if you tell us what you're trying to do with it?{}to[]you cannot rely on.lengtheither: string keys don't affect.length, and numeric keys simply bump.lengthto the highest index+1. In other words, you should answer @Douglas' question...