en.javascript.info/1-js/04-object-basics/04-object-methods/8-chain-calls/_js.view/solution.js
2022-01-22 22:37:02 +03:30

16 lines
No EOL
218 B
JavaScript

let ladder = {
step: 0,
up: function() {
this.step++;
return this;
},
down: function() {
this.step--;
return this;
},
showStep: function() {
alert(this.step);
return this;
}
};