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

What Are Generic Functions

What is a generic function in TypeScript?

Answer options

  • A function that only accepts the any type as a parameter
  • A function that automatically converts data types
  • A function exported from a generic module
  • A function with type parameters (e.g., <T>) that works with different types while maintaining type safety

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