短评 · ·

X 归档 2018-06-22

1 条动态 · 图 1 · 视频 0
If you create a var outside of a function, it ends up on the global scope, but that doesn't happen with let/const. http://jsbin.com/leyadif/1/edit?js,console
如果你在函数外创建一个 var,它会落到全局作用域,但 let/const 不会这样。
@jaffathecake 的配图 1/1