Skip to content

Instantly share code, notes, and snippets.

@robertcoopercode
Created January 9, 2019 00:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save robertcoopercode/ae51ae35f3f59a04eea485f1f5eb0840 to your computer and use it in GitHub Desktop.
Save robertcoopercode/ae51ae35f3f59a04eea485f1f5eb0840 to your computer and use it in GitHub Desktop.
interface Animal {
kind: string;
weight: number;
}
let dog: Animal;
dog = {
kind: 'mammal',
weight: 10,
}; // ✅
dog = {
kind: true,
weight: 10,
}; // ❌ - kind should be a string
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment