I have a json response that looks a bit like this
[{"name":"Dude", "id":"1", "Category": "One"},
{"name":"Guy, "id":"12", "Category": "One"},
{"name":"Thomas" "id":"12", "Category": "Two"},
{"name":"Richard", "id":"2", "Category": "One"},
{"name":"Harold", "id":"3", "Category": "One"},
{"name":"Pete", "id":"4", "Category": "Two"}]
I'd like to be able to loop through this object, and make a neat array of all the different kinds of categories, for example,
["One", "Two"]
if I were to loop through this one. I've tried to create a for/if loop that would ignore a category if it's already been mentioned, but with little success. is there a better way of doing this?