Loading lesson path
TypeScript
Exercises, quizzes, examples, and short drills that reinforce typescript core.
TypeScript has a specific syntax for typing arrays. Read more about arrays in our JavaScript Array chapter. Example const names: string[] = []; names.push("Dylan"); // no error // names.push(3); // E…
TypeScript has a specific syntax for typing objects. Read more about objects in our JavaScript Objects chapter. Example const car: { type: string, model: string, year: number } = { type: "Toyota", mo…
Union types are used when a value can be more than a single type. Such as when a property would be string or number. Union | (OR) Using the | we are saying our parameter is a string or number Example…
Master TypeScript with React through comprehensive examples and best practices. Learn to build type-safe React applications with confidence.
Learn how TypeScript infers types automatically for variables, functions, and expressions. See contextual typing, best common type, const assertions, and more with examples.