文章列表
也许你尝试过这样写JS代码:
function sayHello(name, message){
alert("Hello! " + name + message);
}
function sayHello(name){
alert("Hello! " + name);
}
sayHello("Peter", "Nice to see you.");
可惜你永远也不会得到你想要的结果,这段代码只会返回"Hello! Peter",因为它只会执行第二个function. ...