File tree Expand file tree Collapse file tree
1-js/04-object-basics/04-object-methods/8-chain-calls Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -4,11 +4,7 @@ importance: 2
44
55# 체이닝
66
7- <<<<<<< HEAD
87올라가기(` up ` )와 내려가기(` down ` ) 메서드를 제공하는 객체 ` ladder ` 가 있습니다.
9- =======
10- There's a ` ladder ` object that allows you to go up and down:
11- >>>>>>> upstream/master
128
139``` js
1410let ladder = {
@@ -25,11 +21,7 @@ let ladder = {
2521};
2622```
2723
28- <<<<<<< HEAD
2924메서드를 연이어 호출하고자 한다면 아래와 같이 코드를 작성할 수 있습니다.
30- =======
31- Now, if we need to make several calls in sequence, we can do it like this:
32- >>>>>>> upstream/master
3325
3426``` js
3527ladder .up ();
@@ -40,18 +32,10 @@ ladder.down();
4032ladder .showStep (); // 0
4133```
4234
43- <<<<<<< HEAD
4435` up ` , ` down ` , ` showStep ` 을 수정해 아래처럼 메서드 호출 체이닝이 가능하도록 해봅시다.
45- =======
46- Modify the code of ` up ` , ` down ` , and ` showStep ` to make the calls chainable, like this:
47- >>>>>>> upstream/master
4836
4937``` js
5038ladder .up ().up ().down ().showStep ().down ().showStep (); // shows 1 then 0
5139```
5240
53- <<<<<<< HEAD
5441참고로 이런 방식은 자바스크립트 라이브러리에서 널리 사용됩니다.
55- =======
56- Such an approach is widely used across JavaScript libraries.
57- >>>>>>> upstream/master
You can’t perform that action at this time.
0 commit comments