<script type="text/javascript">
var num1 = 5;
var num2 = 10;
var message = "The sum of 5 and 10 is " + num1 + num2;
alert(message);
</script>
复制代码 代码如下:
<script type="text/javascript">
alert(null == undefined);
alert(null === undefined);
alert("NaN" == NaN);
alert("NaN" === NaN);
alert(NaN == NaN);
alert(NaN === NaN);
alert(NaN != NaN);
alert(NaN !== NaN);
alert(false == 0);
alert(false === 0);
alert(true == 1);
alert(true === 1);
alert(null == 0);
alert(undefined == 0);
alert(5 == "5");
alert(5 === "5");
</script>