We're sorry but this app doesn't work properly without JavaScript enabled. Please enable it to continue.

This lesson's interactive features are locked, please to keep using them

Basic Types

TypeScript adds type annotations to JavaScript variables using a : followed by the type. The most common primitive types are:

const bootupMessage: string = "starting server...";
const port: number = 3000;
const isOnline: boolean = true;
const noValue: null = null;
const notDefined: undefined = undefined;

If a value doesn't match its type, TypeScript throws a compilation error:

const bootupMessage: string = 123;
// Error: Type 'number' is not assignable to type 'string'.

Assignment

We have a compilation bug!

Fix the type of the supportAiLogs variable so that the TypeScript compiler doesn't throw an error.