javascript - jQuery if and else with filter -


I have a filter and this script has been used for filtering.

  filteredData = filteredData filter (function () {var alm = $ (this), value = purse ('0' + elm. 'Rtr (' data-value '), 10) || 0; if ($ (value & lt; 15)) {Return! (250 & lt; = value);} and {Return! (Slider data }}});   

But something is wrong Price value is 15 or more but the code does not enter the other structure.

Try removing $ () call function from this line
  If ($ (value <15)) << code>  

should be:

  if (value  $ ()  returns an object, and all the objects are "true" so this code will always be  if  block  else  The block is known in the  block instead.  

(By the way, assuming that you can fix the above problem, then ! Within the ! (250 always True because value will be will ! <15> , then you can also say that is true; that is true At the point.)

Comments