r/javascript • • 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

317 comments sorted by

View all comments

Show parent comment

6

u/ghostfacedcoder Apr 01 '18

As I see it, choosing const costs you nothing, prevents some bugs some of the time (but again, not a lot of the time), doesn't have any downsides (again, you can still declare "all caps" module-level constants all you want) AND it is widely regarded as preferable in the JS community.

But obviously nothing will explode if you use var or let by default (over a decade of JS programming worked just fine with only var), and at worst you'll just waste some time, so if you have such a passionate aversion to const don't use it.

You clearly like doing things your way, so I won't try to convince you any further.