Typescript
검색결과
1
개
Typescript Chapter 7 : Index signatures & keyof Assertions
https://www.youtube.com/watch?v=gieEQFIfgYc&t=9179s 에러가 발생한다. Indexed Access Types이란? https://www.typescriptlang.org/docs/handbook/2/indexed-access-types.html 이렇게 element 는 함축으로 any 타입을 가지고 있다. 왜냐면 string 표현은 index type 에 사용될수 없기 때문이다. 여기서도 에러가 발생한다. key값이 string .이라는 것을 명시하고 valuer 가 number 이라는것을 명시해야 에러가 없어진다. 단점 typescript 는 미래에 어떤 이름이 들어갈지 모른다. TodaysTransactiosn 에는 dave 라는key 가 없음에도 에러가 발생하..
Typescript
2023. 11. 14. 15:40



