//js 面向对象子多态
function Poly() {
let arglen = arguments.length;
zero=function () {
console.log(0);
}
one=function () {
console.log(1);
}
two=function () {
console.log(2);
}
switch (arglen){
case 0:
return zero();
case 1:
return one();
case 2:
return two();
}
}
new Poly();
new Poly(0);
new Poly(0,1);