单项选择题
function f(x,y=5,z){return[x,y,z];}报错的选项是()
A.f()
B.f(1)
C.f(1,undefined,2)
D.f(1,,2)
点击查看答案&解析
相关考题
-
单项选择题
function m2({x,y}={x:0,y:0}){return[x,y];} 函数使用错误的是()
A.m2()//[0,0]
B.m2({x:3,y:8})//[3,8]
C.m2({x:3})//[3,0]
D.m2({z:3})//[undefined,undefined] -
单项选择题
函数使用正确的是() functionlog(x,y){y=y||’World’;console.log(x,y);}
A.log(’Hello’)//Hello
B.log(’Hello’,’China’)//China
C.log(’Hello’,’’)//Hello
D.log(’Hello’,’China’)//HelloChina -
单项选择题
表达式:if(0n){console.log(’if’);}else{console.log(’else’);}正确的返回是()
A.//else
B.//if
C.undefined
D.null