Can someone please explain to me what bug people think they are catching by choosing `const` in ES6 programs over `let`?
@mrspeaker so the worry is that you might later on forget that you *really meant* constant and mutate the binding?
-
-
@mrspeaker Remember that `let x = 1; let x = 2;` is an error. -
@wycats Yes, but `let x=1; x=2;` is not an error while with const it is. If I don't want x to ever change, I use `const` /cc@mrspeaker
End of conversation
New conversation -
-
-
@wycats what I really want is Scala's "val" - which is more like "var foo = {...}; Object.freeze(foo);". Plus, only 3 letters ;)Thanks. Twitter will use this to make your timeline better. UndoUndo
-
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.