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