Skip to content

Instantly share code, notes, and snippets.

@ianks
Created June 21, 2017 21:57
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 ianks/183c2d59c634f5d3d3d49bf777397c34 to your computer and use it in GitHub Desktop.
Save ianks/183c2d59c634f5d3d3d49bf777397c34 to your computer and use it in GitHub Desktop.
ts1.ts
interface Named {
name: string;
}
let x: Named;
let y = { name: "John", age: 42 };
// This is OK because Y meets the interface requirements of Named
x = y;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment