I am currently building an API for JavaScript, predominantly using Visual Studio 2010 and JetBrains WebStorm (brilliant if you're looking for a bulletproof JavaScript IDE).
Whilst looking through the intellisense list in Visual Studio (trying to familiarize myself with the JavaScript API), I noticed that both Document and document exist.
- What is the difference between
Documentanddocument? - What is
documentan instance of (if any) ? - How does one use
Document(as it is not a function, therefore, not constructable)? - Most importantly, What is the harm in "monkey-patching"
Documentto make it constructable?
The rationale behind these questions is that I want to create some objects that fit into my API (for example; Document, HTMLElement etc.), but as these appear to already exist in some respect, I'm not confident that I should be overwriting their native implementation.