The other day I thought I saw an object iterator in jQuery that had a flag that could be set to recursively iterate over child objects. I thought it was part of jQuery.each(), but now I don't see that capability in the docs.
Is there any such iterator in jQuery that can be automatically recursive?
(I know how to do it in javascript. Just wondering if I actually saw what I thought I saw.)
Thanks much!
EDIT: To be clear, I was thinking of a utility method like jQuery.each() that will iterate recursively over javascript objects and their nested objects.
Given the example below, the each() method would iterate over all objects, including the nested one in myobj.obj2.key2.
I could have sworn that I saw something in jQuery docs about that, but now I can't find it.
Thanks.
var myobj = {
obj1: {key1:'val1', key2:'val2'},
obj2: {key1:'val1', key2: {nest1:'val1', nest2:'val2', nest3:'val3'}},
obj3: {key1:'val1', key2:'val2'}
}
$jQuery.each(myobj, function(key,val) {
// Code to run over each key/val pair
// Does so recursively to include all nested objects
})