Javascript's scope chaining is one of my most and least favourite things about the language. But it's a damn clever approach once you get it.