I\'ve just started using jquery and I\'m really enjoying using selectors. It occurs to me that the idiom would be a very nice way to traverse object trees (e.g., JSON query resu
simplest and easiest way is to wrap the element with jquery and then loop it by each
var obj = { 'foo': 1, 'bar': 2, 'child': { 'baz': [3, 4, 5] } }; $(obj).each(function(){ console.log(this); if(this.hasOwnProperty('foo')) { console.log("hey i found " + this.foo ); } });