js中boolean类型的理解

时间:2016-05-13 14:09:47   收藏:0   阅读:107
<html>
<head>

<script type="text/javascript">
        var x="12";
		alert(x+234);
		alert(typeof (x+234));
		var flag=false;  //true=1 false=0;
		alert(flag+34);
</script>
</head>
<body>
   String str="ere";
   int x= 123;
   str+x;
</body>  
</html>

在js中boolean类型的值有两个true和false

其中true=1;

false=0;

和c中的差不多;

原文:http://www.cnblogs.com/lonecloud/p/5487957.html

评论(0
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!