This code is a part of a constructor function body in javascript:
window.addEventListener("load", function(){
this._updateFilter();
}.bind(this));
_updateFilter method belongs to prototype object of that constructor:
Constructor.prototype._updateFilter = function(){
// some code
};
I am confused with the thing that _updateFilter is called before new instance of Constructor is created. So there is no:
var obj = new Constructor();
But _updateFilter is invoked onload? Can someone explain this please ?
Thanks
_updateFilterbefore instances are created. Please show us the whole code or provide an example that demonstrates this odd behaviour.window.addEventListener("load", this._updateFilter.bind(this))