I have a simple question, but i couldn't find the answer.
In ECMA5 javascript is there a way to method overload?
In this example I try to overload my ECMA5 class constructor, but it doesn't work.
function Classe1(arg1){
console.log('OVERLOAD 1!');
}
function Classe1(arg1,arg2){
console.log('OVERLOAD 2!');
}
var obj = new Classe1('arg1');
var obj = new Classe1('arg1','arg2');
When I run the code above it returns 'OVERLOAD 2' 2 times.