1
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 get the key Season and group in a new array like this:
{"season 1":[{episode:1},{episode:2}], "season 2":[{episode:1},{episode:2}]}
as I take the values of an api, so there is no way I can define "if Season == 1", I have to take these settings dynamically.
thanks for the note, I’ve edited the question.
– Leandro