I want to write a simple JavaScript condition for negative value,
I am converting values which is more than 1000
if (val < 1000) {
convert ...
}
Now how can I write the same thing for the negative values !
So for example how can I write if the values are less than -1 to -1000 than do something !
You can say that I can just simply write if the values are less than 0, but I just want to convert values which are -1 to -1000.
if ((val < 1000) || ((val >= -1 ) && (val < -1000))) {
convert ...
}
How I can write this function in JavaScript , anyone knows the solution!
Aucun commentaire:
Enregistrer un commentaire