The Prototype this example won't work unless this is bound to the anonymous function, otherwise this is the window object.
$A(this.columns).each(function(item) {
this.buildHeader(item);
}.bind(this));