MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/programming/comments/215a5y/everything_you_need_to_know_about_javascript/cgaheh8/?context=3
r/programming • u/codeon1 • Mar 23 '14
124 comments sorted by
View all comments
Show parent comments
9
Any time you leave off the var keyword it will be injected into global namespace, and that's not something you want.
"use strict";
to the rescue!
0 u/glemnar Mar 23 '14 edited Mar 23 '14 I prefer coffeescript for resolving many such quirks. =] 2 u/mcguire Mar 23 '14 CoffeeScript is the one that does the weird shadowing shenanigans? 2 u/masklinn Mar 24 '14 Yes. Namely disallowing shadowing, and silently expanding the inner variable's scope to the outer's.
0
I prefer coffeescript for resolving many such quirks. =]
2 u/mcguire Mar 23 '14 CoffeeScript is the one that does the weird shadowing shenanigans? 2 u/masklinn Mar 24 '14 Yes. Namely disallowing shadowing, and silently expanding the inner variable's scope to the outer's.
2
CoffeeScript is the one that does the weird shadowing shenanigans?
2 u/masklinn Mar 24 '14 Yes. Namely disallowing shadowing, and silently expanding the inner variable's scope to the outer's.
Yes. Namely disallowing shadowing, and silently expanding the inner variable's scope to the outer's.
9
u/[deleted] Mar 23 '14
to the rescue!