同问
开发者问题收集
为什么这些 JavaScript 片段即使都遇到错误,但行为却不同?
var a = {}var b = {}try{a.x.y = b.e = 1 // Uncaught TypeError: Cannot set property 'y' of undefined} catch(err) {console.error(err);}console.log(b.e) // 1var a = {}var b = {}try {a.x.y.z = b.e = 1 //
javascript
operators
order-of-execution
2019-02-12
«
1
»