我在javascript中有一个函数:
function test(a, b, c) {
if(typeof b == "undefined")
//do something
//function code
}
Run Code Online (Sandbox Code Playgroud)
现在我想以这样的方式调用这个函数,以便typeof b remains undefined和a & c containes值(没有重新排序a,b&c)一样
test("value for a", what i can pass here so that b type will be undefined, "value for c")
Run Code Online (Sandbox Code Playgroud)
简单地通过undefined(没有引号):
test("value for a", undefined, "value for c");
Run Code Online (Sandbox Code Playgroud)