Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: incorrect output NaN -> Infinity #226

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ TypeScript는 독특한 구문 때문에 JavaScript 코드를 오류로 보지
console.log(4 / []);
```

구문적으로 옳은(syntactically-legal) 위 코드는 JavaScript에서 `NaN`을 출력합니다.
구문적으로 옳은(syntactically-legal) 위 코드는 JavaScript에서 `Infinity`을 출력합니다.
그러나 TypeScript는 배열로 숫자를 나누는 연산이 옳지 않다고 판단하고 오류를 발생시킵니다:

```
Expand Down Expand Up @@ -184,4 +184,4 @@ TypeScript는 JavaScript와 구문과 런타임 특성을 공유하므로, JavaS
* You can+should read existing JS resources
* Just paste it in and see what happens
* Consider turning off 'strict' -->


Loading