"+字符+"格式问题
程序代码:
function sayHi(name, message) { alert("Hello " + name + "," + message ); } var hi = sayHi("Nicholas", "how are you today?"); 为什么: alert("Hello " + name + "," + message ); 中的: name前后加了"++" 而: message不用加.
function sayHi(name, message) { //在方法中传递了name、message两个参数 alert("Hello " + name + "," + message ); //弹出提示框的完整内容是:“Hello ***(name传的参数) ,*******(message传的参数)” }name前后是字符串,所以用+号连接。明白了吗?