inf http://www.w3schools.com/jsref/jsref_parseint.asp
var a = parseInt("10") + "<br>";
var b = parseInt("10.00") + "<br>";
var c = parseInt("10.33") + "<br>";
var d = parseInt("34 45 66") + "<br>";
var e = parseInt(" 60 ") + "<br>";
var f = parseInt("40 years") + "<br>";
var g = parseInt("He was 40") + "<br>";
var h = parseInt("10",10)+ "<br>";
var i = parseInt("010")+ "<br>";
var j = parseInt("10",8)+ "<br>";
var k = parseInt("0x10")+ "<br>";
var l = parseInt("10",16)+ "<br>";
var n = a + b + c + d + e + f + g + "<br>" + h + i + j + k +l;
The result of n will be:
10
10
10
34
60
40
NaN
10
10
8
16
16
10
10
34
60
40
NaN
10
10
8
16
16
沒有留言:
張貼留言