JavaScript issue in Android 4.1.2 -


this question has answer here:

i have piece of javascript code :

var val = parseint("08"); alert("val : " + val); 

it displays val 0.

where same piece of code in ios displays 8.

can shed more light on issue ?

thanks.

it's because using parseint without defining radix use. thinks using 8 radix.

try this:

var val = parseint('08', 10); 

Comments

Popular posts from this blog

php - Why I am getting the Error "Commands out of sync; you can't run this command now" -

ruby - Nesting modules inside of a Rails eninge gem -

Eclipse formatter for java ending braces -