title: When I return true in Javascript, it returns as undefined
body: <p>I call a javascript function from another as show below, but every time isPassword gets called, it returns as 'undefined' and not True or False as intended. I print the values before they get returned and they are correct, but return true; doesn't work still. Any ideas?</p>
  
  <pre><code>function isPassword(pass){
  
  var datatosend = {};
  datatosend['api'] = 'checkpassword';
  datatosend['version'] = 'v1';
  datatosend['pass'] = pass;
  
  jsonAPI(datatosend,function()
  {
      if (typeof(responseVar['success'])=='boolean')
      {
          var ans = responseVar['success'];
          if (ans)
          {
              //Returns true to changePassword();
              return true;
          }
          else if (!ans)
          {
              //Returns false to changePassword();
              return false;
          }
      }
  });
  }
  
  function changePassword(){
  
      //THE BELOW isPassword CALL IS UNDEFINED
      if(isPassword(oldPass)){
          successStatus.text("Current password not entered correctly");
          successStatus.css('color', 'red');
          clearTextAfter('changePasswordStatus', 5000);
          return false
      }
  }
  </code></pre>
  
  <p>I can provide more code on request if it's more then a simple problem.</p>