单项选择题
A.p1.__proto__===p2.__proto__//false B.p1.__proto__===p2.__proto__//true C.p1.__proto__===p2.__proto__//报错 D.p1.__proto__===p2.__proto__//没有可比性,不会有任何返回
class Point{constructor(x,y){this.x=x;this.y=y;}toStrin...
单项选择题class Point{constructor(x,y){this.x=x;this.y=y;}toString(){return’(’+this.x+’,’+this.y+’)’;}}根据题干选出正确的答案()
A.var point=new Point(2,3);point.toString()//(2,3) B.var point=new Point(2,3);point.toString()//(3,2) C.var point=new Point(1,3);point.toString()//(2,3) D.var point=new Point(12,13);point.toString()//(2,3)
class Foo { constructor() { return Object.create(null);...
单项选择题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;newB...
单项选择题类必须使用()调用,否则会报错。这是它跟普通构造函数的一个主要区别,后者不用()也可以执行
A.new;new B.this;this C.prototype;prototype D.tostring;tostring