<!DOCTYPE html>
<html>
<head>
<title></title>
</head>
<body>
<script type="text/javascript">
var num1="100";
var num2="200";
var num3="300";
document.write("num1='100' num2='200' num3='300'" );
var result=Number(num1)+Number(num2);
document.write("<br>数值的运算结果为:",result);
var st=String(num1);
result=st+200;
document.write("<br>字符串与数字的运算结果为:",result);
var sr=Boolean(num2);
result=sr*num1;
document.write("<br>字符串与布尔值的运算结果为:",result);
</script>
</body>
</html>
添加回答
举报
0/150
提交
取消