File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed
1-js/04-object-basics/04-object-methods/8-chain-calls Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -2,9 +2,9 @@ importance: 2
22
33---
44
5- # Chaining
5+ # Łączenie
66
7- There's a ` ladder ` object that allows to go up and down :
7+ Mamy tutaj obiekt ` ladder ` który pozwala wspinać się do góry i schodzić w dół :
88
99``` js
1010let ladder = {
@@ -15,13 +15,13 @@ let ladder = {
1515 down () {
1616 this .step -- ;
1717 },
18- showStep : function () { // shows the current step
18+ showStep : function () { // pokazuje aktualną wartość step
1919 alert ( this .step );
2020 }
2121};
2222```
2323
24- Now, if we need to make several calls in sequence, can do it like this :
24+ Jeśli chcielibyśmy wykonać sekwencję ruchów, możemy zrobić to w ten sposób :
2525
2626``` js
2727ladder .up ();
@@ -30,10 +30,10 @@ ladder.down();
3030ladder .showStep (); // 1
3131```
3232
33- Modify the code of ` up ` , ` down ` and ` showStep ` to make the calls chainable, like this :
33+ Zmodyfkuj kod dla ` up ` , ` down ` i ` showStep ` żeby można było połączyć wywołania kroków, w taki sposób :
3434
3535``` js
3636ladder .up ().up ().down ().showStep (); // 1
3737```
3838
39- Such approach is widely used across JavaScript libraries .
39+ Wiele bibliotek JavaScript wykorzystuje taki sposób pisania kodu .
You can’t perform that action at this time.
0 commit comments