title: jQuery: Validation based on constant value, eg (+50 or -50) constant value with same currency
body: <p>Have requirement like I need to compare one threshold value with sum of the total value (count) and will compare like based on threshold if threshold value <code>+50 or -50</code> and selected records have same currency. Need to do the successful validation. If beyond more than <code>+50 or -50</code> not allowed to success validation.</p>
  <p>I tried the below validation, its passing at <code>+50</code> (passed) and failed at <code>-50</code> (failed) validation.</p>
  <pre><code>var theresholdVal = 50;
  for (let i = 0; i &lt; jsonData1.length; i++) {
      for (let j = 0; j &lt; jsonData2.length; j++) {
          if (jsonData1[i]['Currency'] !== jsonData2[j]['Currency']) {
              alert(&quot;Currency is mismatched, please select same currency!!!&quot;);
              return false;
          } else if (theresholdVal &lt;= parseInt(countVal)) {
              alert(&quot;Selected value is more thereshold value&quot;);
              return false;
          } else {
              alert(&quot;Data matched successfully!!!&quot;);
          }
      }
  }
  </code></pre>
  <p><a href="http://jsfiddle.net/1mhcxeg5/2/" rel="nofollow noreferrer">Fiddle</a></p>