0
Parseint()
a='2'; c=parseint(a,10); document.write(c); what output c ?
7 Réponses
+ 2
10 is to indicate what base is the value, in this case it is decimal number. Other example is 16, this is to indicate that the value would be in hexadecimal.
+ 2
There is an error because 'parseint' is not defined ( you must write 'parseInt' -- JS, like almost languages, is case sensitive ^^ )...
But missing 'var' keyword raise an error only in JS 'strict' mode... what you should explicitly activate ;)
+ 1
Error no output.
Unless the code is:
var a = '2';
var c = parseInt(a,10);
document.write(c);
Then the output is 2.
0
oh sorry, forgot wrote var
0
and the meaning 10 are?
0
ok. i got it.
thanks very a lot
0
ok. im sorry, ill remember