Skip to content

Instantly share code, notes, and snippets.

@cassiozen
Created November 29, 2018 00:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cassiozen/6e4f81ba6e5f1ef1bff4c7e1120ae3a5 to your computer and use it in GitHub Desktop.
Save cassiozen/6e4f81ba6e5f1ef1bff4c7e1120ae3a5 to your computer and use it in GitHub Desktop.
class Monster {
constructor(name, color, numEyes) {
this.name = name;
this.color = color;
this.numEyes = numEyes;
}
speak(likes) {
return `My name is ${this.name} and I like ${likes}`;
}
}
var nhama = new Monster("Nhama", "red", 1);
nhama.speak("guacamole")
// "My name is Nhama and I like guacamole"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment