+ 1
Is there a symbol for infinity in JavaScript?
I want to create an if else command where if the input value is any number 0 through infinity it will carry out as planned. What should I do?
3 Answers
+ 8
Simply test if the value is greater than zero:
var test = 42;
if ( test >= 0 ) {
// do something
}
else {
// do another thing
}
+ 6
Yes, it's Infinity.
0
Thank you so much!