单项选择题
var p1 = new Point(2,3);var p2 = new Point(3,2);根据提干选择合适的选项()
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;}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); }}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
