Skip to content

Instantly share code, notes, and snippets.

@diegodelfin7
Created November 7, 2016 20:50
Show Gist options
  • Save diegodelfin7/8118c808311c858f8c261801c410c8da to your computer and use it in GitHub Desktop.
Save diegodelfin7/8118c808311c858f8c261801c410c8da to your computer and use it in GitHub Desktop.
class Student {
fullName : string;
constructor(public firstName, public middleInitial, public lastName) {
this.fullName = firstName + " " + middleInitial + " " + lastName;
}
}
interface Person {
firstName : string;
lastName : string;
}
function greeter(person : Person) {
return "Hello ," + person.firstName + " " +person.lastName;
}
var user = new Student("Jane", "M . ", "User");
document.body.innerHTML = greeter(user);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment