What is the use case for var in ES6?

前端 未结 4 1215
既然无缘
既然无缘 2020-11-27 07:24

If the let keyword introduces a proper implementation of block scope, does var any longer have a use case? I am looking at this from a software des

4条回答
  •  没有蜡笔的小新
    2020-11-27 07:43

    let can't be used in global scope yet. var can.

    This is what you get from Chrome when you try a global let outside of strict mode:

    Block-scoped declarations (let, const, function, class) not yet supported outside strict mode

提交回复
热议问题