i have this json returned from my ajax call
[
{message:"haha", type:"error"},
{message:"nice work", type:"success"},
{message:"closed.", type:"success"}
]
and I need to find out if any of the items are of the type error. Now I know I can loop through and figure it out but I wonder if if there is a function that I could tell me what i need to know
{message: "haha", type: "error"}would become{"message": "haha", "type": "error"}.indexOf(). I'll add an answer.