<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title></title>
</head>
<body>
<script type="text/javascript">
var x=123;
document.write('正常显示:'+parseInt(x)+'<br />');
document.write('转二进制: '+parseInt(x,2)+'<br />');
document.write('转十进制:'+parseInt(x,10)+'<br />');
document.write('转16进制:'+parseInt(x, 16)+'<br />');
document.write('忽略前后空格:'+parseInt(' 123 ')+"<br/>");
document.write('12.3转成:'+parseInt('12.3')+'<br />');
document.write('ab123c字符会转化为NaN:'+parseInt(' ab123c ')+'<br />');
document.write('<hr color="red"/>')
document.write('0123转为浮点数:'+parseFloat('0123')+'<br/>');
document.write('0x123转为浮点数:'+parseFloat('0x123')+'<br/>');
document.write('2e2转为浮点数:'+parseFloat('2e2')+'<br/>');
document.write('<hr color="red"/>')
document.write('判断123是否为NaN:'+isNaN('123')+'<br />');
document.write('判断a123是否为NaN:'+isNaN("a123")+"<br />");
document.write('判断turu是否为NaN:'+isNaN('turn')+'<br />');
document.write('判断false是否为NaN:'+isNaN(false)+'<br />')
document.write('<hr color="orange"/>');
document.write('isFinite用于判断+Infinity,-Infinity,NaN结果为false,其他即如果为turn: '+isFinite('123')+'<br />');
document.write('isFinite用于判断+Infinity,-Infinity,NaN结果为false,其他即如果为turn: '+isFinite('Infinity')+'<br />');
</script>
</body>
</html>