title: Global variable is logged as undefined when passed as parameter to setTimeout callback function
body: <p>I have some JS code as below:</p>
  <pre class="lang-js prettyprint-override"><code>var x = self.someAJAXResponseJSON; // x has some object value here.
  
  setTimeout(function(x){
    console.log(&quot;In setTimeout:&quot;, x); // But x is undefined here
  }, 1000);
  </code></pre>
  <p>So I want to pass <code>x</code> to the <code>setTimeout</code> callback function. But I am getting <code>x</code> as undefined inside the <code>setTimeout</code>.</p>
  <p>What am I doing wrong?</p>
  <p>Any idea how to fix a similar issue using Dojo.js?</p>
  <pre class="lang-js prettyprint-override"><code>setTimeout(dojo.hitch(this, function(){
    this.executeSomeFunction(x); // What should this be?
    console.log(&quot;In setTimeout:&quot;, x); // But x is undefined here
  }), 1000);
  </code></pre>