Skip to content

Instantly share code, notes, and snippets.

@DanielHoffmann
Last active July 18, 2023 12:30
Show Gist options
  • Save DanielHoffmann/ca4c7cbd4c32baf9086fecbaa871a8e7 to your computer and use it in GitHub Desktop.
Save DanielHoffmann/ca4c7cbd4c32baf9086fecbaa871a8e7 to your computer and use it in GitHub Desktop.
type A = {
a: string
b: string
}
const c = {
a: 'a',
b: 'b',
c: 'c',
}
const a: A = c // valid
Object.keys(a) // a, b, c
a.c = "c2" // error
a.d = "d" // error
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment