Node.js ES6 edit

constlet declarations

Unlike var, const/let are bound to lexical scope rather than function scope.

{
  var x = 1 // will escape the scope
  let y = 2 // bound to lexical scope
  const z = 3 // bound to lexical scope, constant
}

console.log(x) // 1
console.log(y) // ReferenceError: y is not defined
console.log(z) // ReferenceError: z is not defined

Run in RunKit

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:


Table Of Contents
2 npm
42 cli
60 Hack
65 ES6
92 CORS
106 N-API
  ↑ ↓ to navigate     ↵ to select     Esc to close