Skip to content

Instantly share code, notes, and snippets.

@semuserable
Last active May 21, 2017 17:21
Show Gist options
  • Save semuserable/3c2b13cefa54a0fd57987c355dbd5680 to your computer and use it in GitHub Desktop.
Save semuserable/3c2b13cefa54a0fd57987c355dbd5680 to your computer and use it in GitHub Desktop.
interface Person {
age: number,
name: string,
say(): string
}
let mike = {
age: 25,
name:"Mike",
say: function() {
return "My name is " + this.name +
" and I'm " + this.age + " years old!"
}
}
function sayIt(person: Person) {
return person.say();
}
console.log(sayIt(mike))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment