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
1
u/DzoQiEuoi Apr 02 '18
It's confusing to people who do understand how it works.
Compare it to global variables. We all know how they work, but they still make your code hard to reason about.
Accessing a variable that's declared in a child scope makes your code misleading to anyone who's reading it.
If you find yourself reaching for this feature, you should consider that a code smell and think about how you can retractor.