added showStep to our chain in the solution

This commit is contained in:
Tofpu 2021-11-16 09:52:12 +02:00 committed by GitHub
parent 83d20033e4
commit 690c223335
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -23,7 +23,7 @@ let ladder = {
}
};
ladder.up().up().down().up().down().showStep(); // 1
ladder.up().up().down().showStep().down().showStep(); // shows 1 then 0
```
We also can write a single call per line. For long chains it's more readable:
@ -33,7 +33,7 @@ ladder
.up()
.up()
.down()
.up()
.showStep() // 1
.down()
.showStep(); // 1
.showStep(); // 0
```