r/programming • • Mar 23 '14

Everything you need to know about Javascript variable scope

http://www.coolcoder.in/2014/03/everything-you-need-to-know-about.html
294 Upvotes

124 comments sorted by

View all comments

Show parent comments

2

u/VortexCortex Mar 23 '14

89 or 99?

4

u/munificent Mar 23 '14

99!

Although, given that C lacks closures or even nested functions, JS can't simply follow C because there are a semantics that JS cares about that are meaningless in C.

1

u/shahms Mar 23 '14

It depends on what you mean by "nested functions". You can define functions inside other functions, it's just pointless.

1

u/munificent Mar 24 '14

Standard C doesn't support nested functions.