Created
March 28, 2017 05:39
-
-
Save devmobasa/262ee343ea3a2a244ec76b44f6723713 to your computer and use it in GitHub Desktop.
TypeScript - intersection types simple example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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