반응형
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
- caching
- web vital
- vue
- svelte
- custom command
- Cypress
- api test
- rendering
- 선택자
- http3
- typeScript
- csr
- devtools
- JavaScript
- 비동기
- CSS
- CloudFlare
- vue-cli
- SSR
- msw
- Testing
- ts error
- https
- import.meta.env
- e2e
- aws
- ViTE
- QUIC
- vue3
- TLS
Archives
- Today
- Total
목록가독성 (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