Skip to content

Instantly share code, notes, and snippets.

@Ibro
Created March 28, 2017 05:39
Show Gist options
  • Save Ibro/262ee343ea3a2a244ec76b44f6723713 to your computer and use it in GitHub Desktop.
Save Ibro/262ee343ea3a2a244ec76b44f6723713 to your computer and use it in GitHub Desktop.
TypeScript - intersection types simple example
interface IStudent {
id: string;
age: number;
}
interface IWorker {
companyId: string;
}
type A = IStudent & IWorker;
let x: A;
x.age = 5;
x.companyId = 'CID5241';
x.id = 'ID3241';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment