title: Why does JSON.stringify() returns undefined when passed a replacer function?
body: <p>When I pass a function as the second parameter into <code>JSON.stringify()</code> and test for the value of the key, I get undefined. Any idea why?</p>
  
  <pre><code>var person = {
      name: "Siddharth",
      age: 23,
      sex: 0,
      phone: 12345
  };
  
  personString = JSON.stringify(person, personFilter, 2);
  console.log(personString);
  
  function personFilter(key, value) {
      if (key == "age") {
          return value;
      }
  }
  </code></pre>
  
  <p><a href="http://jsfiddle.net/mggut/" rel="nofollow">fiddle</a></p>