Skip to content

Commit 83d2003

Browse files
authored
added showStep method to our chain in the task
1 parent a829155 commit 83d2003

File tree

1 file changed

+3
-1
lines changed
  • 1-js/04-object-basics/04-object-methods/8-chain-calls

1 file changed

+3
-1
lines changed

1-js/04-object-basics/04-object-methods/8-chain-calls/task.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,14 @@ ladder.up();
2828
ladder.up();
2929
ladder.down();
3030
ladder.showStep(); // 1
31+
ladder.down();
32+
ladder.showStep(); // 0
3133
```
3234

3335
Modify the code of `up`, `down` and `showStep` to make the calls chainable, like this:
3436

3537
```js
36-
ladder.up().up().down().showStep(); // 1
38+
ladder.up().up().down().showStep().down().showStep(); // shows 1 then 0
3739
```
3840

3941
Such approach is widely used across JavaScript libraries.

0 commit comments

Comments
 (0)