title: JSON serialization algorithm in express.js
body: <p>I'm curious what is the algorithm the express uses to serialize objects to JSON and if there's a way to modify it.</p>
  
  <p>I notice that it only serializes objects' own properties, which makes it difficult to send out objects that inherit from other objects. It also omits any properties whose value is <code>undefined</code>. I understand that functionally, omitting them is the same as including them and saves bandwidth, but including them makes the JSON more discoverable for people reading it trying to figure out how to use an API.</p>
  
  <p>In any case, it's a question more about how express does things and less about what my code should do :=)</p>