An interesting question is found in learning javascript: Beginners think JavaScript is similar to Java when they first start learning, except that JavaScript is a weakly typed language; Interestingly, JavaScript does not support overloaded functions. If you write a function overload JavaScript like Java does not give an error, this is the interesting place---not supported but not wrong. So for a function with the same name, when the call is simply to call the last function, it's like the last function overwrites the previous function with the same name. You can look at an example:
function Test (A, B, c) {return
a+b+c;
}
function Test (A, b) {return
a+b;
}
function test () {return
' Hello world ';
}
Window.alert (Test (1,2,3));
Window.alert (Test (1,2));
Window.alert (Test ());
All three calls to the function call the last Test () function, which pops up "Hello world" ...
In fact, I think the JavaScript function is to support the number of variable parameters, but also weak type language, from these two points does not support the function overload.