Last active
February 20, 2017 21:08
-
-
Save mokargas/f6fcf2509593690c81a371ea85c70adf to your computer and use it in GitHub Desktop.
Your const isn't constant
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
//Const doesn't currently confer immutability, it gives immutable binding: https://mathiasbynens.be/notes/es6-const | |
//Will work how you expect | |
const baz = 42 | |
baz = 10 | |
//Won't work how you expect | |
const foo = { bar: 1 } | |
foo.bar = 2 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment