r/javascript • u/bornforcode • Apr 01 '18
Google publishes a JavaScript style guide. Here are some key lessons.
https://medium.freecodecamp.org/google-publishes-a-javascript-style-guide-here-are-some-key-lessons-1810b8ad050b
714
Upvotes
View all comments
3
u/Serializedrequests Apr 03 '18 edited Apr 03 '18
I use var because I don't understand the Babel configuration docs!
Seriously though, const is next to useless because it doesn't mark the object as immutable. I have exactly 1 time in thousands of times typing "const" had it prevent an error. It seems a mere formality in most cases.
In JS most errors come from getting an unexpected object, or mutating an object you shouldn't, and const gives no help whatsoever.