для твоего образца.
function cat(name, age) {
this.excuses = ['пнх', 'схб' /*здесь можно написать отмазы ленивого кота*/];
this.name = name;
this.age = age;
this.прыжков = 0;
}
cat.prototype = {
sayhello: function () { console.log("hello! my name is " + this.name); },
jump: function (height) {
if (this.прыжков > 3) console.log(this.excuses[math.random() * this.excuses.length | 0]);
else console.log(height > this.age ? "nonono i'm too young. bro! " : "jump");
this.прыжков++;
}
};
a.