单项选择题
function CreatePerson(){this.name = "xiaoming";}var foo = new CreatePerson();以上代码中this是对( )的引用。
A.window
B.Foo
C.foo
D.function
点击查看答案
相关考题
-
单项选择题
function consoleLog(){console.log(i);var i = 10;console.log(i);}consoleLog();console.log(i);以上代码的打印结果分别是()
A.10,10,undefined
B.undefined,10,undefined
C.undefined,10,程序报错
D.10,10,程序报错 -
单项选择题
class Point{constructor(x,y){this.x=x;this.y=y;}toString(){return’(’+this.x+’,’+this.y+’)’;}}const oP=new Point(10,10);console.log(oP.toString())以上代码运行结果正确的是()
A.10,10
B.(10,10)
C.[object object]
D.以上都不对 -
单项选择题
class是es6新增得特性,以下关于class类代码正确的是()
A.class A(){};new A()
B.class A{};newA()
C.class A{};A()
D.class A{};letobjA=A()
