Would like to create array like this:
track[divID][wrapID]
I couldn't use track[divID][wrapID] = wrapID
cos some more will be added to 2nd dimension in another loop like this: track[divID][wrapID,wrapID2]
var track =[];
$("div").each(function() {
var wrapID = $(this).parent().attr('id')
var divID = $(this).attr('id')
track[divID].push(wrapID)
});
the Error is "Uncaught TypeError: Cannot read property 'push' of undefined "
What did I do wrong ? Many thanks.
track[divID][wrapID,wrapID2]would just evaluate totrack[divID][wrapID2]due to how the comma operator works