javascript - 0 + integer is weird in JS -
this question has answer here:
- leading 0 in javascript 3 answers
go browser's js console , try these:
-14 // -14 -014 // -12 -24 // -24 -024 // -20 -0024 // -20 012 // 10
why 0-integer construct giving me results 2 smaller in absolute value?
"never write number leading 0 (like 07). javascript versions interpret numbers octal if written leading zero." (see: http://www.w3schools.com/js/js_numbers.asp)
Comments
Post a Comment