If I had done that with Javascript, I can assure you that function based scoping would have destroyed my brain in trying to debug. But since I read a book on Javascript[1] that assumed familiarity with other languages, I was prepared for it.
[1]: https://www.amazon.com/Professional-JavaScript-Developers-Ni...
After reading hundreds of blogs and articles about this or that programming language being supposedly "simple", sentences like the above have come to mean nothing.
I wish a had a succinct meme to describe what actually happens in the real world around "simple" languages but the concepts are:
If there's a "small" or "simple" FORMAL language specification, it means there's a "large" INFORMAL language out in the wild. The "informal" will include things like idioms, patterns, macros, code generators, industry practices, "utility" javascript libraries, etc.
For example, take the concept of "classes" that supposedly nobody needs in Javscript (because protoype chains are superior). What is the longest most complicated chapter of Nicholas Zaka's Javscript books[1]?! It's the long chapter on manually simulating classes using prototypes! Same situation with other books that describe home-grown "modules". Even if one chooses to avoid simulated classes in his own js code, one still has to understand the different variations that others write. If classes are not formally specified in the language spec, it's informally specified in everyone else's books, stackoverflow answers, blog articles, and youtube videos explaining js simulated classes. If Javascript had "classes" earlier than ES6, perhaps the over abundance of informal adhoc "class objects" would have been completely avoided.
Another example would be "optional default" function parameters. Since javascript's formal language spec doesn't have a feature for default params, it is "simpler" and "easier to learn". (Hey, if one doesn't have to memorize the keyword "optional", that's one less thing to worry about, right?) Hmmm... really?! Look again more closely.[2] The "optional" feature is simply moved into an idiom (multiple idioms!) that all competent javascript programmers must learn. The "smaller" language hasn't saved any complexity -- it does the opposite -- it made JS usage more complex overall.
Any language that's used for non-trivial purposes will not be "simple" if looked at holistically by combining both the formal and informal real-world uses of it.
However, within that unavoidable complexity, there can be limited subset cases of "simple" for certain scenarios. What does one want a "simple" Javascript language spec for and what can it do? Make the monkey dance?[3] Ok, that's one mapping of "simple" to an end goal and 1995 Javascript specification is probably enough. However, people want to do much more complex apps with Javascript without having to mess around with Typescript, Babel transpiler, etc.
To blog writers: please stop characterizing languages as "simple" without any qualifications of use cases. That adjective is no longer convincing on its own.
[1]http://www.amazon.com/Professional-JavaScript-Developers-Nic...
[2]http://stackoverflow.com/questions/148901/is-there-a-better-...
Useful books. The first is online and free (the other two are as well, somewhere): http://eloquentjavascript.net/
http://www.amazon.com/Professional-JavaScript-Developers-Nic...
http://www.amazon.com/JavaScript-Patterns-Stoyan-Stefanov/dp...
Solve toy problems to solidify knowledge of methods and syntax: http://coderbyte.com/CodingArea/Challenges/
Good material- lots of video and problems. Not free but worth it: https://www.codeschool.com/ (makers of the jQuery videos below)
Bootstrap - popular front-end framework: http://getbootstrap.com/
Actually build something! A To Do List, a website, a game.
See some different frameworks do the same things: http://todomvc.com/
jQuery: http://try.jquery.com/
Here is a good free node tutorial: http://nodeschool.io/
Some tracks to learn, and get connected with non-profits to make useful things: http://www.freecodecamp.com/
Contributing to open source projects is another route.
http://www.amazon.com/Professional-JavaScript-Developers-Nic...
There is one shorter book that he wrote recently: https://leanpub.com/oopinjavascript
Professional Javascript for Web Developers[1] is a favorite of mine, because it doesn't waste time teaching you to program and teaching you the language. Instead it points out things that will surprise you if you come from C-like languages, and things you need to watch out for.
Now, since I effectively learned to program in C and later C#/Java, ___ for node developers isn't what I'm after, especially if it spends a bunch of time talking about static typing or fixed size arrays and such. But if you're going the opposite way as I did, learning the high level and transitioning to the low level, something like that could be very useful indeed.
[1]: https://www.amazon.com/Professional-JavaScript-Developers-Ni...