const result = typeof class extends Array {}
结果?
assert.equal(result, 'object')
assert.equal(result, 'array')
assert.equal(result, 'function')
assert.equal(result, 'class')
答案
const result = new Foo(3).length; class Foo extends Array {}
会发生什么?
assert.equal(result, 3)
assert.equal(result, undefined)
ReferenceError(引用错误)
class Foo extends Array {} const result = new Foo(3).length;