单项选择题
class Foo { constructor() { return Object.create(null); }}Foo()//执行结果是什么?()
A.Object
B.TypeError:Class constructor Foo cannot be invoked without’new’
C.Function
D.String
点击查看答案
相关考题
-
单项选择题
类必须使用()调用,否则会报错。这是它跟普通构造函数的一个主要区别,后者不用()也可以执行
A.new;new
B.this;this
C.prototype;prototype
D.tostring;tostring -
单项选择题
constructor方法默认返回(),完全可以指定返回另外一个对象
A.字符串
B.数组
C.实例对象
D.Set结构 -
单项选择题
一个类必须有构造方法,如果没有显式定义,一个空的()方法会被默认添加
A._constuctor
B.toString
C.constructor
D._clone
