Dev Helpers
← Back

Read a typed property

Read a typed property using TypeScript.

Open this example in the interactive library

Source code

interface Job {
  id: number;
  name: string;
  done: boolean;
}
const job: Job = { id: 1, name: "Build", done: false };
console.log(job.name.toUpperCase());

Sample output

BUILD