title: set value for a global variable in local nested function
body: <p>I have the following function</p>
  
  <pre><code>function fileExists(FileName) {
      var retvar="false";
      window.requestFileSystem(LocalFileSystem.PERSISTENT, 0, function(fileSystem) {
  
        fileSystem.root.getFile(FileName, null,
             function() {
                fileEntry.file(function() {
                   alert("Exists");
                },
                function() {
  
         });
        },
        function () {
            retvar = "true";
            alert(retvar);  //says true
        });
       },null);
  
      alert(retvar);  //says false
  }
  </code></pre>
  
  <p>here, i have to set the value of retvar as true in the inner nested function. I can't pass that value outside that function. Could any one tell me any idea for passing that value to the parent function?</p>