const
const x;
会发生什么?
assert.equal(x, undefined)
语法错误
答案
const obj = {a: 1}; obj.a = 2;
assert.equal(obj.a, 1)
assert.equal(obj.a, 2)
类型错误
const obj = {a: 1}; obj = {};
assert.deepEqual(obj, {})
const value = 'a'; { const value = 'b'; console.log(value); } console.log(value);
'a', 'a'
'b', 'b'
'a', 'b'
'b', 'a'