js随笔

xiaoxiao2021-02-28  86

js随笔这关键字arguments

function f1(){ switch(arguments.length){ case 0: console.log("without information"); break; case 1: console.log("姓名"+arguments[0]); break; case 2: console.log("姓名"+arguments[0]+"年龄"+arguments[1]) } } f1();//without information f1("lzy");//姓名lzy f1("lzy",24);//姓名lzy年龄24
转载请注明原文地址: https://www.6miu.com/read-97323.html

最新回复(0)