Last active
December 21, 2015 05:18
-
-
Save olov/6255863 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[:~/projects/js] % cat const.js | |
"use strict"; // required to opt-in ES6 block scope in V8 for now | |
console.log("const assignment error is caught at parse-time so this doesn't get printed"); | |
const limit = 100; | |
limit = 200; | |
console.log(limit); | |
[:~/projects/js] % node --harmony const.js | |
/Users/olov/projects/js/const.js:4 | |
limit = 200; | |
SyntaxError: Assignment to constant variable. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment