title: Access a variable inside a function which is inside a function in javascript?
body: <p>How can I access a variable inside a function which is inside a function in javascript ?</p>
  
  <pre><code>var a;
  var surveyObjects = Parse.Object.extend(surveyObject);
  var query= new Parse.Query(surveyObjects);
  query.count({
      success: function(count){a = count;},
      error: function(error){}
  });
  alert("count of function "+a);
  </code></pre>
  
  <p><code>a</code> is showing <code>undefined</code> value. I need to use the value of <code>a</code> outside.</p>