Hey gang!
So, I've gotten a pretty good handle on integrating simple JavaScript functions into my project. I'm now trying to use JavaScript in conjunction with an Array I have in my project...
Here's what's going down:
I have an array (ARR_SongRelease) that stores generated songs: X[0] = Artist Name, X[1] = Song Name, X[2] = Streams Generated For That Song. Whenever a new song is generated in the game, it adds a new entry on the Array's 'Y' access. The array is saved in local storage! This all works great :)
However, I'm trying to display the top 15 songs (based on the Streams, or X[2] value).
Here is what my main.js function is looking like:
And here is what's happening in the event sheet:
From a little bit of debugging, I've concluded that the issue has something to do with how ARR_SongRelease is being requested, because the code works perfectly fine in VS Codium using a test array. I'm wondering if I have a simple syntax issue somewhere (as I've never tried to call upon a Construct array in JS before), or if the issue is deeper, like my Local Storage, and it's trying to run this function before the data from the Array is even loaded?
Any and all help would be greatly appreciated :)