6 Replies
it thinks 076 is an octal representation of a number because of the leading zero
just guessing from this one line, but if you're running into this as a bug, you're probably misusing
eval
and should just use parseInt("076", 10)
. The 10 forces parseInt
to treat the number as a decimal numberIt doesn’t “think” it’s octal, it is octal :p
I've been doing too much with strongly typed languages, what really is, is a string ;P
Numbers that start with
0
are octal numbersoh wait, I see what you mean, the string is getting run as javascript code because of
eval
, so "076" isn't a string by the time it's runI get it now. Thanks