怎么将string类型转换成bool类型
展开全部
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title></title>
<script type="text/javascript">
var a = "";
document.write("空字符串:" + typeof (a) + " 类型," + "转成bool类型是 :" + Boolean(a));
</script>
</head>
<body>
</body>
</html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title></title>
<script type="text/javascript">
var a = "";
document.write("空字符串:" + typeof (a) + " 类型," + "转成bool类型是 :" + Boolean(a));
</script>
</head>
<body>
</body>
</html>
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询