美文网首页
var VS let VS const

var VS let VS const

作者: mihope | 来源:发表于2019-01-10 12:28 被阅读3次

    var:

      function scoped

      undefined when accessing a variable before it's declared

    let:

      block scoped

      ReferenceError when accessing a variable before it's declared

    const:

      block scoped

      ReferenceError when accessing a variable before it's declared

      can't be reassigned

    相关文章

      网友评论

          本文标题:var VS let VS const

          本文链接:https://www.haomeiwen.com/subject/hjzorqtx.html