unknown vs. any in Typescript
· ☕ 1 min read
Why use unknown when we have any in Typescript?
Type inferences are powerful and allows us to do magic when we don’t know types.
1 2 3 const i: any = 1; console.log(i); // 1 unknown seems to do the same thing.
1 2 let x: unknown = 1; console.