반응형
Notice
Recent Posts
Recent Comments
Link
| 일 | 월 | 화 | 수 | 목 | 금 | 토 |
|---|---|---|---|---|---|---|
| 1 | ||||||
| 2 | 3 | 4 | 5 | 6 | 7 | 8 |
| 9 | 10 | 11 | 12 | 13 | 14 | 15 |
| 16 | 17 | 18 | 19 | 20 | 21 | 22 |
| 23 | 24 | 25 | 26 | 27 | 28 | 29 |
| 30 |
Tags
- import.meta.env
- aws
- https
- devtools
- http3
- typeScript
- SSR
- api test
- ts error
- 비동기
- Cypress
- rendering
- vue3
- CloudFlare
- QUIC
- 선택자
- Testing
- TLS
- vue-cli
- e2e
- vue
- CSS
- web vital
- caching
- svelte
- JavaScript
- csr
- msw
- custom command
- ViTE
Archives
- Today
- Total
목록Pipe (1)
Develop Note by J.S.
[Javascript] Function Pipeline
1. Function Pipelineconst addFive = (x) => x + 5;const double = (x) => x * 2;const minusOne = (x) => x - 1;const result = minusOne(addFive(double(10)));특정 값을 여러 함수에 순차적으로 전달하여 결과를 사용하는 코드는 가독성이 떨어집니다. Pipe를 정의하고 이를 사용해 코드 리팩토링 시 가독성이 좋아질 것입니다. 1) 코드 정의 // common.tsexport const _ = { filter(predicate) { return (array) => array.filter(predicate); }, sort(compareFn) { return ..
Language/Javascript
2024. 8. 29. 11:53