jQuery - How to recursively loop over an object's nested properties?
<p>Is there are a way to recursively loop over all the nested properties of a JS/jQuery object?</p>

<p>For example, given this object</p>

<pre><code>var x = {
    'name': 'a',
    'level': 1,
    'children': [{
        'name': 'b',
        'level': 2,
        'children': [{
            'name': 'c',
            'level': 3,
            'children': [{
            ...
            }]
        }]},
        ...
    }]
}
</code></pre>

<p>how could I loop over the objects named 'a' and their children, 'b' and their children, 'c' and their children, ad infinitum?</p>
