inflearn logo
Course

Course

Instructor

photo's Posts

photo photo

@photo2226

Reviews Written
3
Average Rating
5.0

Posts 9

Q&A

저도 안되서 뭔가 했는데 오타가 있었네요 오타가 없는지 잘 확인해보시길 바랍니당!

Likes
0
Comments
1
Viewcount
352

Q&A

만약에 인터페이스 3개를 상속 받았을 경우에 타입가드를 쓴다면

function ThreeTypeGuard ( typeProduct : Samsung | KIA | Apple ) : any { if ((typeProduct as Samsung ) . phonenumber !== undefined ){ return typeProduct as Samsung ; } else if ((typeProduct as KIA ) . carnumber !== undefined ){ return typeProduct as KIA ; } else { return typeProduct as Apple ; } } phone = { name : " abc " , // phonenumber : 123, // carnumber : 123, Applenumber : 123 , } if ( ThreeTypeGuard (phone)){ phone . Applenumber } 이렇게 하면 한개 함수로 3개를 다 처리 할수 있는거 같습니다.

Likes
1
Comments
2
Viewcount
287

Q&A

tsc index.ts명령어와 npx tsc index.ts의 차이..

저도 윈도우 사용자인데 안되서 찾아보니까 아마 윈도우 보안 이슈가 아닌가 싶습니다. https://m.blog.naver.com/ggomjae/221791639992 window power shell 을 사용자 권한으로 연다음에 시키는대로 하니까 잘되네요

Likes
3
Comments
7
Viewcount
1301