Codington
0 of 6 problems solved0%

Arrays

6 exercises

Arrays are ordered lists of values written as T[] or Array<T>:

const numbers: number[] = [1, 2, 3]; const users: User[] = [{ id: 1, name: "Alice" }];

Now that you can model a single object, it's natural to work with arrays of objects like User[] or Product[].

In this category, you'll:

  • Work with arrays of primitives (summing and filtering numbers)
  • Transform arrays of objects (plucking fields, filtering by property)
  • Use methods like .map(), .filter(), and .find() with proper types
  • Return precise types like T | undefined from .find()
  • Make immutable updates without mutating inputs

By the end, you'll be comfortable writing small, typed helpers that transform arrays safely and predictably.

CodingtonCodington

© 2025 Codington. Built with TypeScript, TanStack Start and a lot of console.log().