每日3题
1 以下代码执行后,控制台中的输出内容为?
class A {
static a = "123";
}
class B extends A {}
console.log(B.a);
2 以下3句语句,哪句是合法的
1.toString();
1..toString();
1...toString();
3 以下代码执行后,控制台中的输出内容为?
const a = [
[0, 1],
[2, 3],
].reduce(
(pre, cur) => {
return pre.concat(cur);
},
[1, 2]
);
console.log(a);
答案及解析
1
class A {
static a = "123";
}
class B extends A {}
console.log(B.a);
2
1.toString();
1..toString();
1...toString();
3
const a = [
[0, 1],
[2, 3],
].reduce(
(pre, cur) => {
return pre.concat(cur);
},
[1, 2]
);
console.log(a);