数值转换

2017-06-14 15:47:00
admin
原创
487
<!DOCTYPE html>
<html>
	<head>
		<title>
			Number Example 4
		</title>
		<script type="text/javascript">
			var num1 = Number("Hello world!"); //NaN
			var num2 = Number(""); //0
			var num3 = Number("000011"); //11
			var num4 = Number(true); //1
			alert(num1);
			alert(num2);
			alert(num3);
			alert(num4);
		</script>
	</head>
	<body>
	</body>
</html>
  • QQ讨论群
  • 关注微信
    • 欢迎咨询
    • 欢迎加入QQ群 16506021
  • 公众号:源宝网络