I have a json object structured like this:
{
"catNames" : ["a1", "a2", "a3", "a4"],
"dogNames" : ["b1", "b2", "b3", "b4"],
"goldfishNames" : ["c1", "c2", "c3", "c4"]
}
what I would like to do is to parse this object and compare an input string, with "catNames", "dogNames", "goldfishNames", if the two match, let's say catNames, I want to print a random element from the catNames array. I'm completely lost ,how can I do this?