I know I can iterate over an object array and check values by utilizing the key. But is there a way to check the key by looking at the value? I use jQuery although I think this is simply a javascript question.
var j = [
{hello : 1},
{hello : 2},
{bye : 3}
]
$.each(j, function(i,item){
if(item.hello==1) alert("hello");
});
How do I make the alert dependent on the value being 1, irrespective of what key it is?