こんな風に適当な基数に変換してくれます。 parseInt("0x37") --> 55 parseInt("37") --> 37 問題はここで、 先頭に 0 のあるhogeは 8 進数と判断されて 0 に変換されしまったのです。 parseInt は基数を指定できます。(指定できる値は「2」「8」「10」「16」) ですので ...
The parseInt() function parses a string argument and returns an integer of the specified radix (the base in mathematical numeral systems). If the radix value (coerced if necessary) is not in range [2, ...