4.4 task chain
<script>
"use strict"
<script>
"use strict"
let ladder = {
step: 0,
up() {
this.step++;
return this;
},
down() {
this.step--;
return this;
},
showStep: function() { // shows the current step
alert( this.step );
}
};
step: 0,
up() {
this.step++;
return this;
},
down() {
this.step--;
return this;
},
showStep: function() { // shows the current step
alert( this.step );
}
};
ladder.up().up().down().showStep();
</script>
</script>
댓글
댓글 쓰기