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