Can't understand why ErrorHandler.prototype.errorsBasket after ajaxComplete got new value
var ErrorHandler = function() {
var _this = this;
$(document).ajaxComplete(function() {
_this.errorsBasket.push([1]);
});
};
ErrorHandler.prototype.errorsBasket = [];
ErrorHandler.prototype.errorsBasket1 = [];
var a = new ErrorHandler();
a.errorsBasket1 = [2];
$.get('/');
$(document).ajaxComplete(function() {
why ->> console.log(ErrorHandler.prototype.errorsBasket); // [Array[1]]
console.log(ErrorHandler.prototype.errorsBasket1); // []
});