Skip to content

Instantly share code, notes, and snippets.

@Joe1220
Created September 30, 2018 08:14
Show Gist options
  • Save Joe1220/a9dbf1c795b742609814d9093441d4f1 to your computer and use it in GitHub Desktop.
Save Joe1220/a9dbf1c795b742609814d9093441d4f1 to your computer and use it in GitHub Desktop.
class User {
public id: number;
public name: string;
public address: string;
public wait: boolean;
constructor(id: number, name: string, address: string, wait: boolean) {
this.id = id;
this.name = name;
this.address = address;
this.wait - wait
}
}
const joe = new User(20, "joe", "[email protected]", false)
function create_mail(info: User): string {
return `${info.name}'s id is ${info.id}. his email address is ${info.address}.
The email will be determined based on the wait(${info.wait}) value. `
};
console.log(create_mail(joe))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment