(note: I took this from _Effective Javascript_)