문서의 선택한 두 판 사이의 차이를 보여줍니다.
| 양쪽 이전 판이전 판다음 판 | 이전 판 | ||
| angular:observable_rxjs:observablescomparedtoothertechniques [2019/03/02 14:28] – [Observables compared to events API] taekgu | angular:observable_rxjs:observablescomparedtoothertechniques [2025/04/15 10:05] (현재) – 바깥 편집 127.0.0.1 | ||
|---|---|---|---|
| 줄 121: | 줄 121: | ||
| });</ | });</ | ||
| | | | | | | | | | | ||
| + | |||
| + | ===== Observables compared to arrays ===== | ||
| + | |||
| + | 관측 대상은 시간이 지남에 따라 값을 산출합니다. 배열은 정적 인 값 집합으로 만들어집니다. 어떤 의미에서, | ||
| + | |||
| + | ^ ^ Observable ^ Array ^ | ||
| + | |Given |< | ||
| + | obsB: ➞' | ||
| + | arrB: [' | ||
| + | |concat() |< | ||
| + | ➞1➞2➞3➞5➞7➞' | ||
| + | [1, | ||
| + | |filter() |< | ||
| + | ➞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</ | ||
| + | |||
| + | |||