mercredi 8 novembre 2017

How to check javascript number range?

How following if condition true for ids=1

var ids = 1;

if (9 <= ids <= 14) {

  console.log(9 <= ids <= 14)

}

I want it to be true only if the value of ids between 9 and 14. Appreciate any help understanding how JavaScript operators work when checking range.

Aucun commentaire:

Enregistrer un commentaire