Skip to content

Instantly share code, notes, and snippets.

@jasonbyrne
Created April 14, 2022 04:20
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 jasonbyrne/e34f1e072715af06143bbff47cdf0630 to your computer and use it in GitHub Desktop.
Save jasonbyrne/e34f1e072715af06143bbff47cdf0630 to your computer and use it in GitHub Desktop.
Eggs Benedict
type FoodProperties = {
name: string;
description: string;
price: number;
section: "breakfast" | "lunch" | "dinner" | "dessert";
};
class FoodItem {
constructor(private opts: FoodProperties) {}
public get(property: string) {
return this.opts[property];
}
}
const EggsBenedict = new FoodItem({
name: "Eggs Bendict",
description:
"A house specialty! English muffin with Canadian bacon, two poached eggs, and Hollandaise Sauce.",
price: 5.99,
section: "breakfast",
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment