We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 1dc6dfb + 82e5d13 commit 025f588Copy full SHA for 025f588
1-js/04-object-basics/04-object-methods/8-chain-calls/_js.view/solution.js
@@ -11,5 +11,6 @@ let ladder = {
11
},
12
showStep: function() {
13
alert(this.step);
14
+ return this;
15
}
16
};
1-js/04-object-basics/04-object-methods/8-chain-calls/_js.view/test.js
@@ -32,6 +32,14 @@ describe('Ladder', function() {
32
it('down().up().up().up() ', function() {
33
assert.equal(ladder.down().up().up().up().step, 2);
34
});
35
+
36
+ it('showStep() should return this', function() {
37
+ assert.equal(ladder.showStep(), ladder);
38
+ });
39
40
+ it('up().up().down().showStep().down().showStep()', function () {
41
+ assert.equal(ladder.up().up().down().showStep().down().showStep().step, 0)
42
43
44
after(function() {
45
ladder.step = 0;
0 commit comments