Question · JavaScript and TypeScript course · Module 6: TypeScript Basics

The never Type

When do we use the never type in TypeScript?

Answer options

  • For null and undefined values
  • For functions that never return a value (throw an error or have an infinite loop)
  • For variables that have not been initialized yet
  • For optional fields in interfaces

You can check the correct answer by solving this task in the CodeWorlds game.