How do you add a type annotation to a function parameter `name` of type string?

TypeScript Associate Easy

TypeScript Associate — Easy

How do you add a type annotation to a function parameter `name` of type string?

Key points

  • Type annotations in TypeScript help define the data type of variables or parameters.
  • The correct syntax for adding a type annotation to a function parameter is `parameterName: type`.
  • Incorrect options use different syntax or incorrect placement of type annotations.

Ready to go further?

Related questions