减法

2017-06-15 10:53:00
admin
原创
325
<!DOCTYPE html>
<html>
	<head>
		<title>
			Subtract Example 1
		</title>
		<script type="text/javascript">
			var result1 = 5 - true; //4 because true is converted to 1
			var result2 = NaN - 1; //NaN
			var result3 = 5 - 3; //2
			var result4 = 5 - ""; //5 because "" is converted to 0
			var result5 = 5 - "2"; //3 because "2" is converted to 2
			var result6 = 5 - null; //5 because null is converted to 0
			alert(result1);
			alert(result2);
			alert(result3);
			alert(result4);
			alert(result5);
			alert(result6);
		</script>
	</head>
	<body>
	</body>
</html>
文章分类
联系我们
电话: 18902328227
Email: 2689701946@qq.com
QQ: 2689701946
微信: 18902328227
地址: 广州番禺区繁华路
  • 在线客服
  • 关注微信
  • 联系电话
    • 欢迎咨询
    • 欢迎加入QQ群 303257430
  • 公众号:源宝网络
    • 联系电话及微信号 18902328227