<html>
<body>
<script type="text/javascript">
x=3+6;
document.write(x);
document.write("<br />");
x="3"+"6";
document.write(x);
document.write("<br />");
x=3+"6";
document.write(x);
document.write("<br />");
x="3"+6;
document.write(x);
document.write("<br />");
</script>
<p>The rule is: If you add a number and a string, the result will be a string.</p>
</body>
</html>
<body>
<script type="text/javascript">
x=3+6;
document.write(x);
document.write("<br />");
x="3"+"6";
document.write(x);
document.write("<br />");
x=3+"6";
document.write(x);
document.write("<br />");
x="3"+6;
document.write(x);
document.write("<br />");
</script>
<p>The rule is: If you add a number and a string, the result will be a string.</p>
</body>
</html>
No comments:
Post a Comment