I have an array with anonymous elements. Elements are added to the array via php, like so:
$playlist = array();
while (databaseloop) {
$playlist[] = $a_ti
I would suggest that you optimize your code a little bit more so that it would make a bit more sense and be less error prone, if that's possible that is. This is also a great way to be more object-oriented!
Like this (I'm using jQuery here) :
var array = [ {name: "Hello.mp3", time: "00:00:14"}, {name: "Byebye.mp3", time:"00:00:30"}, {name: "Whatsup.mp3", time: "00:00:07"}, {name: "Goodnight.mp3", time: "00:00:19"}];
Then you would be able to loop over it and produce a bit more clean looking code
array.forEach(function(data){
//edit the output here
console.log(data.name + " " + data.time );
});