单项选择题
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() -
单项选择题
ES6提供了更接近传统语言的写法,引入了类这个概念,作为对象的模板。通过什么关键字,可以定义类?()
A.int
B.class
C.var
D.const
