文档09_Javascript重载

arguments.length使用该arguments获取参数集合,实现重载

function test()
{
    if(arguments.length==0)
    {
        alert("0");
    }
    if(arguments.length==1)
    {
        alert("1");
    }
}

test();
test(1)
原文地址:https://www.cnblogs.com/RainbowInTheSky/p/3075607.html