Skip to content

Instantly share code, notes, and snippets.

@Vannevelj
Created November 19, 2015 15:15
Show Gist options
  • Save Vannevelj/fc5a632cb2ec7310abc6 to your computer and use it in GitHub Desktop.
Save Vannevelj/fc5a632cb2ec7310abc6 to your computer and use it in GitHub Desktop.
class Book {
constructor(title, author) {
this.title = title;
this.author = author;
}
display() {
const displayString = `${this.title} by ${this.author}`;
console.log(displayString);
}
static createGiveaway(title) {
console.log(`here's your free copy of "${title}"!`);
}
/**
* Thanks the given publisher
* @param {String} publisher
*/
thankPublisher(publisher) {
console.log(`Thank you so much ${publisher}! I love you!`);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment