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

1장 정리 #16

Open
hyunahOh opened this issue Sep 18, 2022 · 0 comments
Open

1장 정리 #16

hyunahOh opened this issue Sep 18, 2022 · 0 comments
Assignees

Comments

@hyunahOh
Copy link
Collaborator

-> 타입스크립트는 자바스크립트의 상위호환이다.
이 부분 좀 이해가 안갔는데, 타입스크립트에서 자바스크립트 원래 문법대로 하면 에러나니까. 근데 타입에러는 컴파일에러가 아니고, 컴파일과 별도의 과정이라고 함.

-> 타입스크립트는 런타임에 영향을 주지 않는다.
타입 변환하게 해줘도 자바스크립트 상에서 타입변환은 일어나지 않는다. 위의 과정과 같은 이유.

-> 타입스크립트는 덕타입팅 기반이다.
따라서 실제로 instanseof같이 타입이라는 요소가 별도로 있는게아니고, property를 비교하는 방식의 타입체킹을 하기 때문에, 똑같은 요소만 있으면 타입에러가 안난다. 이건 뒤에서 자세히 설명해주신다 함.
같은 이유로 테스트돌리기좋음 모킹용.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant