Here is a script that needs attention:
Bla = function() {
this.prop = 123;
}
Bla.prototype.yay = function() {
console.log(this,this.prop);
}
X = new Bla();
$(document).ready(X.yay); // output: #document undefined --> why?
$(document).ready(function(){
X.yay(); // output: Bla 123 --> desired result
});
What can be done to ensure that the first call functions correctly (with 'this' referring to X) without extending Object?