문서의 선택한 두 판 사이의 차이를 보여줍니다.
| 양쪽 이전 판이전 판다음 판 | 이전 판 | ||
| angular:observable_rxjs:observablescomparedtoothertechniques [2019/03/02 14:33] – [Observables compared to arrays] taekgu | angular:observable_rxjs:observablescomparedtoothertechniques [2025/04/15 10:05] (현재) – 바깥 편집 127.0.0.1 | ||
|---|---|---|---|
| 줄 127: | 줄 127: | ||
| ^ ^ Observable ^ Array ^ | ^ ^ Observable ^ Array ^ | ||
| - | |Given |< | + | |Given |< |
| - | |concat() |< | + | obsB: ➞' |
| - | |filter() |< | + | arrB: [' |
| - | |find() |< | + | |concat() |< |
| - | |findIndex() |< | + | ➞1➞2➞3➞5➞7➞' |
| - | |forEach() |< | + | [1, |
| - | |map() |< | + | |filter() |< |
| - | |reduce() |< | + | ➞5➞7</ |
| + | [5, 7]</ | ||
| + | |find() |< | ||
| + | ➞5</ | ||
| + | 5</ | ||
| + | |findIndex() |< | ||
| + | ➞3</ | ||
| + | 3</ | ||
| + | |forEach() |< | ||
| + | console.log(v); | ||
| + | }) | ||
| + | 1 | ||
| + | 2 | ||
| + | 3 | ||
| + | 5 | ||
| + | 7</ | ||
| + | console.log(v); | ||
| + | }) | ||
| + | 1 | ||
| + | 2 | ||
| + | 3 | ||
| + | 5 | ||
| + | 7</ | ||
| + | |map() |< | ||
| + | ➞-1➞-2➞-3➞-5➞-7</ | ||
| + | [-1, -2, -3, -5, -7]</ | ||
| + | |reduce() |< | ||
| + | ➞1➞3➞6➞11➞18</ | ||
| + | 18</ | ||