web-interview
web-interview copied to clipboard
[选择题] 40.(单选题)下面代码的输出是什么
let newList = [1, 2, 3].push(4);
console.log(newList.push(5));
A:[1,2,3,4,5]
B: [1,2,3,5]
C: [1,2,3,4]
D: Error
答案:D
解析:
.push()方法返回数组的长度,而不是数组的本身。