JSFiddle - React, Tailwind, and code Playground
JavaScript
function Huhn() {
this.eier = 0;
}
Huhn.prototype.legeEi = function() {
this.eier -= -1;
};
(function() {
var alt = Huhn.prototype.legeEi;
Huhn.prototype.legeEi = function() {
alt.apply(this);
alert(this.eier);
};
})();
var myHuhn = new Huhn();
myHuhn.legeEi();