You are confusing DOM with Javascript. A classic mistake. The main difference between Javascript and the rest of the languages is how it deals with globals and dependencies. The rest of the languages you are very limited on how and which libraries you can use, some times dependency resolutions are like sudokus. But, in Javascript, you can include two versions of the same library without conflicts. The use of the closure is so smart that it overcomes all the problems that other languages have with their globals and statics symbols. The http://www.modulecounts.com/ is proof of this, while other languages have problems to increase their libraries, Javascript libraries can grow without limits.