TypeScript Basics

Your first types, one idea at a time: annotations, object types, optional parameters, literal unions, arrays and a first generic.

  1. 01

    Add Types to a Function's Parameters

    • easy
    • Code
  2. 02

    Describe an Object with a Type

    • easy
    • Code
  3. 03

    Make a Parameter Optional

    • easy
    • Code
  4. 04

    Accept Only a Few Exact Strings

    • easy
    • Code
  5. 05

    Type an Array of Numbers

    • easy
    • Code
  6. 06

    Allow Two Kinds of Value

    • easy
    • Code
  7. 07

    Return a Value or Nothing

    • easy
    • Code
  8. 08

    Write Your First Generic Function

    • easy
    • Code