单项选择题
下面代码的输出是什么?()
function sum(a, b) {
return a + b;
}
sum(1, "2");
A.NaN
B.TypeError
C."12"
D.3
点击查看答案
相关考题
-
单项选择题
下面代码的输出是什么?() function Person(firstName, lastName) { this.firstName = firstName; this.lastName = lastName; } const lydia = new Person("Lydia", "Hallie"); const sarah = Person("Sarah", "Smith"); console.log(lydia); console.log(sarah);
A.Person{firstName:"Lydia",lastName:"Hallie"} and undefined
B.Person {firstName: "Lydia", lastName: "Hallie"} and Person {firstName: "Sarah", lastName: "Smith"}
C.Person {firstName: "Lydia", lastName: "Hallie"} and {}
D.Person{firstName:"Lydia",lastName:"Hallie"}and ReferenceError -
单项选择题
下面代码的输出是什么?() var a = 3; var b = new Number; var c = 3; console.log(a == b); console.log(a === b); console.log(b === c);
A.true false true
B.falsefalse true
C.true false false
D.false true true -
单项选择题
下面代码的输出是什么?() let c = { greeting: "Hey!" }; let d; d = c; c.greeting = "Hello"; console.log(d.greeting);
A.Hello
B.undefined
C.ReferenceError
D.TypeError
