QQ交流群:110826636

文档09_Javascript重载

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

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

test();
test(1)

 

posted @ 2013-05-13 13:40  FourOne  阅读(200)  评论(0编辑  收藏  举报