Thank you for all your help! This is way more complicated than I thought It would be.... Is there no way to use the local storage to save the gem value they obtain (as it would always be different) and then ask it to pull up that value when the final score layout plays?
I'm a bit confused but I think I know what you mean.
So if you aren't concerned with saving gem values between playthroughs (i.e. they are set to 0 each time you play) then you don't need local storage. The arrays are global so they will have persistent values between layouts. That means you don't need anything fancy to set text from the array.
However, if you want to save your array values and have them return when you play again, you'll want to use the Local Storage object. Local Storage loads asynchronously, so loading from it on the start of the layout you're hoping to use it's data for isn't always going to get you the desired result. Instead what you'd probably want to do is have your Local Storage load values into your array when the game first starts, and save those values at the end of your levels (for example, I'm not sure when would be best to update variables in your project, specifically). That way the array is ready by the time you get playing and can be updated without touching the Local Storage object. The Local Storage would only be used to get the array primed for play.