타입스크립트
타입 확정하기 Narrowing & Assertion 강의 숙제1번 문제풀이중에 질문이 있습니다.
아래와 같이 함수를 작성했는데요.
표시한 부분에서 arr[i] 쪽에 에러가 납니다.
TS2345: Argument of type 'string | number' is not assignable to parameter of type 'string'. Type 'number' is not assignable to type 'string'.
narrowing 잘 한거 같은데 에러가 왜 나는 걸까요?ㅠㅠ