function test(a,b){ var a=arguments[0]||1; var b=arguments[1]||2; console.log(a) console.log(b) } test(undefined,2)
运行结果