//测试同名方法 function testFun() { showResult('this is a function named \'testFun\' with no arguments.'); }; function testFun(arg) { showResult('this is a function named \'testFun\' with one argument,the argument is '+arg); }; testFun(); testFun("jQuery");
?
结论:方法重名,JS会以最后定义的函数作为函数体。当然这不包括JS中的继承中的覆盖。?