YEP, it works, but that's only because you use it inside anonymous function, which is called without scope context and therefore this == global. Change it explicitly to global. (eg. if I use strict mode, it wouldnt' work, or if somebody refactor the this function to be called with this bound).