title: Node.js - Remove null elements from JSON object
body: <p>I am trying to remove null/empty elements from JSON objects, similar to the functionality of the python webutil/util.py -> trim_nulls method. Is there something built in to Node that I can use, or is it a custom method.</p>
  
  <p>Example:</p>
  
  <pre><code>var foo = {a: "val", b: null, c: { a: "child val", b: "sample", c: {}, d: 123 } };
  </code></pre>
  
  <p>Expected Result:</p>
  
  <pre><code>foo = {a: "val", c: { a: "child val", b: "sample", d: 123 } };
  </code></pre>