undefined
null
const result = true.unknownProperty;
会发生什么?
assert.equal(result, undefined)
类型错误
语法错误
答案
const result = null.unknownProperty;
给出以下 JavaScript 代码。
let foo; function bar() {} const baz = (x) => x;
以下哪个表达式求值为 undefined?其余的求值为 null。
assert.equal(foo, undefined)
assert.equal(bar(), undefined)
assert.equal(baz(), undefined)
assert.equal(/^#/.exec('Z'), undefined)