So I'm trying to access values in an array returned from a third=party service (Twilio) and I can get exactly what I need when I place
room.participants.forEach(function(participant){
console.log(Array.from(participant.tracks));
});
In Dev Tools, I receive:
(2) [Array(2), Array(2)]
0: (2) ["f469c8e5-4f94-4752-b018-af02d32fe448", AudioTrack]
1: (2) ["be6c2aa6-4c7c-4431-a964-a711f000562a", VideoTrack]
length :2
__proto__ : Array(0)
But the same code in my script produces [] as a result. This isn't an issue of timing, because I am able to console.log both room.participants as well as the map of the individual tracks by using
var myKeys = room.participants.keys();
console.log(myKeys);
var myParticipant = room.participants.get(myKeys.next().value);
console.log(myParticipant);
console.log(myParticipant.audioTracks);
console.log(myParticipant.videoTracks);
But as soon as I attempt to access the values of the tracks through the same methods foo.next().value I receive an empty map and if I try the Array.from() method I receive an empty array.
What is going on?!