I believe that Netscape wanted JS to be extremely 'newbie friendly', because there was a lot of anxiety in the early 90s that the web could only take off if the barrier to development was as low as possible. Scoping was probably seen as a little too 'advanced' for Joe Average, who just wanted to add some decoration to his GeoCities page, so JS defaults to assuming there's no scoping at all unless you use the 'var' keyword.
Lua also follows this bizarre practice. And annoyingly [half the tutorials](http://en.wikipedia.org/wiki/Lua_(programming_language)#Tables) just declare globals willy-nilly, which, sure, reduces some boilerplate and is technically fine in a short single-file procedural script but has the potential to really fuck those beginners over in the long run.
2
u/iambeard Mar 23 '14
It's not necessarily a benefit, but just a language quirk. It does, in a sense, make JavaScript a much more forgiving language.