Skip to content

Instantly share code, notes, and snippets.

@jsmanifest
Created February 24, 2020 04:39
Show Gist options
  • Save jsmanifest/2cf29bdfcfe458721383d4f929d645a9 to your computer and use it in GitHub Desktop.
Save jsmanifest/2cf29bdfcfe458721383d4f929d645a9 to your computer and use it in GitHub Desktop.
function Frog(name) {
this.name = name
}
Frog.prototype.getTeeths = function() {
return 2
}
Frog.prototype.lick = function(target) {
console.log(`I'm going lick you, ${target.name}. You better taste delicious`)
}
// Or with classes
class Frog {
constructor(name) {
this.name = name
}
getTeeths() {
return 2
}
lick(target) {
console.log(
`I'm going lick you, ${target.name}. You better taste delicious`,
)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment