87,920
社区成员
发帖
与我相关
我的任务
分享
<script language="javascript" type="text/javascript">
var a=3,b=5;
function add(x,y){
return x+y;
}
document.write(" <h2>a+b=",+add <a,b>+" <h2>");
</script>
/*相继输出a,b,c三个单词,逗号为分隔号*/
document.write("a","b","c");
/*逗号为分隔号,“<h2>a+b=”为一字符,“add <a”为一
*字符,为算术运算值FALSE;“b>+" <h2>"”为另一运算
*符,为FALSE。其实,最终得到的字符串是:“<h2>a+b=FALSEFALSE”,没有了后面的“</h2>”
*我这样解释,不知道楼主满意不?
**/
document.write(" <h2>a+b=",+add <a,b>+" <h2>");