I have an array of values like this:
[{season:1, episode:1},{season:1, episode:2},{season:2, episode:1},{season:2, episode:2}]
What I want to do is take the key season and group it in a new array like this:
{"season 1":[{episode:1},{episode:2}], "season 2":[{episode:1},{episode:2}]}
As I get the values from an api, then there's no way I can define "if season == 1", I have to get those seasons dynamically.