How to parseInt a string with leading 0

khelll picture khelll · Oct 9, 2009 · Viewed 7.8k times · Source

How to parseInt "09" into 9 ?

Answer

Gabe Moothart picture Gabe Moothart · Oct 9, 2009

include the radix:

parseInt("09", 10);