Why was block scope not originally implemented in JavaScript?

前端 未结 4 1769
闹比i
闹比i 2020-11-29 01:23

I have read, and discovered through my own experience, that JavaScript doesn\'t have a block scope. Assuming that the language was designed this way for a reason, can you ex

4条回答
  •  天命终不由人
    2020-11-29 01:29

    New answer as of 2015. ES6 does have block scope for variable definitions with the let and const keywords.

提交回复
热议问题