title: Is this correct code in Node.js? (variable scoping)
body: <pre><code>function user(req,res){
      var uuu = req.params.userid;
      processUserObject(uuu, function(user_object){ //This could take a long time...
          console.log(uuu); 
          res.send(JSON.stringify(user_object));
      });
  };
  app.get('/:userid',function(req,res){
      user(req,res);
  });
  </code></pre>
  
  <p>First, assume that the site gets lots of hits. (thousands per second!)</p>
  
  <p>When a user hits the page with his ID, will <code>console.log(uuu)</code> output the correct ID?  What I'm worried (in regards to variable scoping) is that when person A hits the page and goes through <code>processUserObject</code>, it could take a long time, during which person B hits the page and <strong>changes uuu</strong>...resulting in console.log to output person B's ID instead of person A's ID.</p>
  
  <p><em><strong>Side note:</em></strong> I have this worry because when I was new to Node.js, I forgot to initialize some variables with <code>var</code>.  When my site got lots of hits, my users noticed that they were getting info from other user's hits...ouch.</p>