单项选择题
分析下面的 JavaScript 代码段,输出的结果是()
function employee(name,code)
{
this.name="wangli";
this.code="A001";
}
var newemp = new employee("zhangming",'A002');
document.write("雇员姓名:"+ newemp.name+ " ");
document.write("雇员代号:"+ newemp.code +" ");
A.雇员姓名:wangli 雇员代号:A001
B.雇员姓名:zhangming 雇员代码:A002
C.雇员姓名:null,雇员代码:null
D.代码有错误,无输出结果
点击查看答案
相关考题
-
单项选择题
下面代码的输出是什么?() const obj = { a: "one", b: "two", a: "three" }; console.log(obj);
A.{a:"one",b:"two"}
B.{b:"two",a:"three"}
C.{a:"three",b:"two"}
D.SyntaxError -
单项选择题
下面代码的输出是什么?() var num = 8; var num = 10; console.log(num);
A.8
B.10
C.SyntaxError
D.ReferenceError -
单项选择题
下面代码的输出是什么?() function checkAge(data) { if (data === { age: 18 }) { console.log("You are an adult!"); } else if (data == { age: 18 }) { console.log("You are still an adult."); } else { console.log(`Hmm.. You dont have an age I guess`); } } checkAge({ age: 18 });
A.You are anadult!
B.You are still an adult.
C.Hmm..You don’t have an age I guess
