Skip to content

Instantly share code, notes, and snippets.

@sentientmonkey
Created November 17, 2017 23:19
Show Gist options
  • Save sentientmonkey/44ed58b613dec7fc0de4e2545ab20782 to your computer and use it in GitHub Desktop.
Save sentientmonkey/44ed58b613dec7fc0de4e2545ab20782 to your computer and use it in GitHub Desktop.
export default class Person {
public name: string = "default"
public address: string = "default"
public age: number = 0;
public constructor(init:Partial<Person> = {} as Partial<Person>) {
this.name = init.name || this.name;
this.address = init.address || this.address;
this.age = init.age || this.age;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment