A typed property read can couple a key to the shape of its record. That relationship catches misspellings before they become missing runtime values.
Worked example
interface Job {
id: number;
name: string;
done: boolean;
}
const job: Job = { id: 1, name: "Build", done: false };
console.log(job.name.toUpperCase());Result
BUILDImplementation notes
A generic key constrained to keyof a record still needs a valid runtime object. Type assertions at the network boundary can undermine this guarantee.
Try it yourself
Rename the property in the type and inspect its callers.
Open the TypeScript example →Editorial date June 28, 2026 · Published December 6, 2026