My rules of thumb for extending JavaScript native objects

by
, posted

I have the following rules of thumb for extending JavaScript’s native objects:

  1. Don’t extend things if you’re making a library.
  2. Shims are okay in the browser.
  3. Don’t touch Object.prototype.

Let’s explore these in a little more depth.

Those are my rules!