Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
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",
"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