title: how to run an function if other function return true on focusout
body: <p>I have 2 inline function calls on focus out event.</p>
  
  <p>I want 2nd function run if 1st function return true without calling the 2nd funtion inside 1st function.</p>
  
  <p>Inside this string <code>01-Dec-2018 - t57 ( 1 )0</code> in brackets is available stock quantity.</p>
  
  <p>i have tried the following code but output is not coming.</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>function checkStockAvailable(batchNo, qty) {
    var startpos = batchNo.indexOf("( ");
    var endpos = batchNo.indexOf(" )");
    var stockQty = batchNo.substring(startpos + 2, endpos);
    if (qty &gt; stockQty) {
      alert("Entered quantity can not be greater than stock quantity, please try again.");
      return false;
    }
    if (qty &lt;= stockQty) {
      return true;
    }
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"&gt;&lt;/script&gt;
  &lt;input type="number" value="10" onfocusout="if((return checkStockAvailable('01-Dec-2018 - t57 ( 1 )0', $(this).val())) == true){saveDetailData('1',$(this).val(),'columnName' )})"&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>no output shows</p>