TypeScript Types

Type annotations let the compiler check how values are used. TypeScript erases annotations when generating JavaScript.

TypeScript
function greet(name: string): string {
  return `Hello, ${name}`;
}
console.log(greet("Ada"));
Read the full lesson