I am using Svelte and was wondering why this won't log anything? Is it something to do with reactivity? I am trying to iterate over an object.
let videoElement: HTMLVideoElement;$: captionLines = [''];$: console.log('captionLines', captionLines);if (videoElement && videoElement.textTracks) { console.log(videoElement.textTracks); if (videoElement.textTracks.length >= 0) { //get to this point... Object.keys(videoElement.textTracks).forEach((key) => { //nothing logs here... console.log(key, videoElement.textTracks[key]); });}
Log: