Recursively search JSON and delete certain sub objects
<p>I need to search a complex json object recursively, and delete the object associated with any key that starts with "_".</p>

<p>So far, I have:</p>

<pre><code>sanitize: function(json){
    for(var i in json){
        if(json[i]){
            if(i.substring(0,1) == "_")
                delete json[i];
            else
                this.sanitize(json[i]);
        }
    }
    console.log(json);
    return json;
}
</code></pre>

<p>I exceed the maximum call stack.</p>
