Record<K, T> builds a dictionary type where each key K maps to a value T. Use it to create fast lookups from arrays. When keys repeat, decide which value wins; here the later item should overwrite the earlier one.
// Example: Record<string, number> for a price tableBuild a price table from a list of items.
type Item = { sku: string; price: number }.priceMap(items: Item[]): Record<string, number>.out[item.sku] = item.price and let later items overwrite earlier ones.