diff --git a/packages/example/src/2week/compose/compose.spec.ts b/packages/example/src/2week/compose/compose.spec.ts new file mode 100644 index 0000000..866ac84 --- /dev/null +++ b/packages/example/src/2week/compose/compose.spec.ts @@ -0,0 +1,14 @@ +import { compose } from './compose' + +describe('pop', () => { + it('더하기 함수와 곱하기합수를 합성했습니다.', () => { + function add(a: number, b: number) { + return a + b + } + function multiply(a: number, b: number) { + return a * b + } + const result = compose(4, add(7), multiply(5)) + assert(result).toBe(55) + }) +}) diff --git a/packages/example/src/2week/compose/compose.ts b/packages/example/src/2week/compose/compose.ts new file mode 100644 index 0000000..236d7b0 --- /dev/null +++ b/packages/example/src/2week/compose/compose.ts @@ -0,0 +1,7 @@ +/** + * 출제자: 상현님 (Hansanghyeon) + * Q. 각자의 방식으로 함수를 합성해보세요! + */ +export const compose = (...arg: any) => { + return null +}