Skip to content

Instantly share code, notes, and snippets.

@robertcoopercode
Created January 9, 2019 00:30
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/9e52a47a95121137fd6d1f502ca8f089 to your computer and use it in GitHub Desktop.
Save robertcoopercode/9e52a47a95121137fd6d1f502ca8f089 to your computer and use it in GitHub Desktop.
type Student = {
id: string;
age: number;
};
type Employee = {
companyId: string;
};
let person: Student & Employee;
person.age = 21; // ✅
person.companyId = 'SP302334'; // ✅
person.id = '10033402'; // ✅
person.name = 'Henry'; // ❌ - name does not exist in Student & Employee
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment