Level 1M8Lesson 8.5

beginner45 minby DevFox

any vs unknown: the escape hatch and the safe box

Meet the two types that take any value and work as opposites: any switches TypeScript’s checks off, while unknown keeps them on until a check says what the value is. Open an unknown with typeof and instanceof, choose the type that keeps TypeScript checking, and give TaskKit’s catch a sentence for anything it catches.

  • Fundamentals
  • TypeScript
`any` vs `unknown`: the escape hatch and the safe box. Read this lesson at .