We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2be21e5 commit aecf2f3Copy full SHA for aecf2f3
src/app.ts
@@ -9,6 +9,7 @@ function printResult(num: number): void {
9
printResult(add(1, 2));
10
11
let result: Function;
12
-result = add
+result = add;
13
+result = printResult; //이렇게 재할당을 할 경우 undefined를 출력한다. 이유는 printResult의 값이 void이기 때문이다.
14
// result = 0; //값이 재할당 되면서 0으로 값이 출력된다.
15
console.log(result(1, 2)); //그렇다면 result 변수에 함수 타입을 지정하면 되지 않을까?
0 commit comments