Odd language for sure, and odd choices too. Basically all is derived from the fact that Netscape created a "scripting" language most likely following roughly the C syntax for the base. The scripting language at the beginning wasn't all that powerful, and was mostly used to check form fields, interact with Java applet and such.
Slowly new features and concept have been added to Javascript, yet they had to keep "compatibility" with the first version of it, otherwise all the websites using the old syntax would not work anymore. THIS is what produced this kind of odd mix we have today. Keeping compatibility is some times really good as you don't break existing things, but most of the time you make things a lot more clumsy as you will not be able to make clean stuff.
Certainly not my preferred language, but yet, offers loads of options to make your page a whole game by itself