It's the kind of thing that could possibly be OK in nodejs but is not OK in the browser. My biggest problem with it (and how it goes down in Rails for that matter) is that you can inadvertently clobber variables in namespaces you don't own. Changing the prototype of String there will change it in the context of every 3rd party library that's also running. It just doesn't scale with the codebase.