title: How JSON.stringify() works internally?
body: <p>How replacer argument function extract key and value from object value and mapped it to its key and value argument in JSON.Stringify(value, replacer, space) method.</p>
  
  <p>I understood that key of the object become the key parameter of the replacer function and value become value parameter of this function.</p>
  
  <pre><code>let user={name:"anup", age:22};
  JSON.stringify(user,function(key,value){
            if(typeof value==="string"){
                 return undefined;
             }
             return value;
   },null);
  </code></pre>
  
  <p>Here name becoming the key of the replacer function and "anup" becoming the value of the replacer function thats fine, but my question is how this mapping is happening?
  Generally we call any method by passing argument in that method call, like</p>
  
  <pre><code> function a(c,d){
    // logic
   }
   a(2,3);
  </code></pre>
  
  <p>But here in stringify method we are not passing any such thing to the replacer function or callback function, then how it is getting mapped?</p>
  
  <p>Actually, I'm a newbie in javaScript world, so something I'm unable to understand. If you guide me in this regard , I'll be very thankful to you.</p>