I’m working on a school project where I want to visualize all the matches of the Champions League. I already have a calendar that shows upcoming matches, but now I want to show the scores of the last 3 play dates.
However, I can’t simple print them because I want the fixtures of the last 3 play dates (I still have to exclude the matches in the future, but that shouldn’t be a problem). I thought about using ‘reverse’ to reverse the array and then using a simple loop to print the scores. Unfortunately, .reverse() doesn’t work because it’s an associative array. How could I still reverse the array so the keys (dates) are displayed descending?
So there is no way to get only the last 3 dates besides using arrays? If not, could you tell me more about using arrays instead of objects? I declared my array like var fixtures = e and filled it with dates like this: fixtures[y['date']] =  where y[‘date’] is the value of the array I’m looping through (the array that contains the data of all fixtures). Then I looped through this fixtures array again, to compare the date with every date in another array that contains all the fixtures, and added the fixture to that fixtures array if the dates matched.