JS中的函数没有重载的概念
js中不像是java,拥有重载的概念,所以函数名相同的函数,js会认为是同一个函数,所以会输出写在最后的一个函数的结果。
function test(){
alert(arguments[0
]);
}
function test(x){
alert(x)
}
function test(x,y){
alert(x+" "+
y)
}
test(7);
结果是:
转载于:https://www.cnblogs.com/justlive-tears/p/9393442.html
相关资源:瑞星杀毒软件V17 v25.00.07.30官方版