Skip to content

Instantly share code, notes, and snippets.

@radzserg
Last active April 7, 2020 11:58
Show Gist options
  • Select an option

  • Save radzserg/43dfb7d2b4cec93e4785ea94d214d344 to your computer and use it in GitHub Desktop.

Select an option

Save radzserg/43dfb7d2b4cec93e4785ea94d214d344 to your computer and use it in GitHub Desktop.
class Cook {
public makeDinner() {
this.cookRoastedDuck();
this.cookCeasarSalad();
this.serveDrinks();
}
private cookRoastedDuck() {
console.log("Prepare the duck");
console.log("Add spices");
console.log("Roast the duck for 3 hours");
}
private cookCeasarSalad() {
console.log("mix salmon, avocado rest of ingredients");
}
private serveDrinks() {
console.log("Pepsi for kids");
console.log("Jack Daniels for grandfather")
}
}
const mom = new Cook();
mom.makeDinner();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment