Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

javascript check negative number

(number < 0)

"-0" < 0 is false, which is consistent with the fact that -0 < 0 is also false (see: signed zero).
"-Infinity" < 0 is true (infinity is acknowledged)
"-1e0" < 0 is true (scientific notation literals are accepted)
"-0x1" < 0 is true (hexadecimal literals are accepted)
"  -1  " < 0 is true (some forms of whitespaces are allowed)

Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #javascript #check #negative #number
ADD COMMENT
Topic
Name
9+3 =