Why Factories are better than Classes in JavaScript……

sex male
2 min readNov 22, 2020

Learn why you should use JavaScript factories over classes with an example……

This is not groundbreaking in any way. My goal is to get you through that night when the thought of cooking makes you want to whine your way into oblivion, but takeout just does not appeal. My go-to on these nights (which happen more often now than ever) is usually an egg dish: frittata or fried eggs and toast — plus, I’m finally getting into omelets……….

https://ocs.archchicago.org/exe/Tex-vs-Pat06.html
https://ocs.archchicago.org/exe/Tex-vs-Pat07.html
https://ocs.archchicago.org/exe/Tex-vs-Pat08.html
https://ocs.archchicago.org/exe/Tex-vs-Pat09.html
https://ocs.archchicago.org/exe/b-v-w-01.html
https://ocs.archchicago.org/exe/b-v-w-02.html
https://ocs.archchicago.org/exe/Jagu-vs-Stee-01.html
https://ocs.archchicago.org/exe/Jagu-vs-Stee-02.html
https://etrainingschool.com/mxc/Tex-vs-Pat04.html
https://etrainingschool.com/mxc/Tex-vs-Pat03.html
https://etrainingschool.com/mxc/b-v-w-03.html
https://etrainingschool.com/mxc/b-v-w-04.html
https://natap.pire.org/mou/Tit-v-Ra-01.html
https://natap.pire.org/mou/Tit-v-Ra-02.html
https://natap.pire.org/mou/Tit-v-Ra-03.html
https://natap.pire.org/mou/Tit-v-Ra-04.html
https://etrainingschool.com/pvm/Stee-v-Jag-Q2.html
https://etrainingschool.com/pvm/Stee-v-Jag-Q1.html
https://etrainingschool.com/pvm/Stee-v-Jag-Q3.html
https://etrainingschool.com/pvm/Stee-v-Jag-Q4.html
https://ocs.archchicago.org/hou/Ea-v-Bro-01.html
https://ocs.archchicago.org/hou/Ea-v-Bro-02.html
https://ocs.archchicago.org/hou/Ea-v-Bro-03.html

But my Holy Grail is the egg in a hole. Part of its pedestal status is probably due to the nostalgia attached to it: My dad made these for me all the time when I was growing up. “Want an egg in the hole?” He’d use the cap of a vitamin bottle to make the circle — which was my favorite part because it got so extra crispy. (That circle, man.)……………..

(It’s worth noting here that my colleague Melissa’s dad made these for her, too, and called them Howdy Doody Eggs. I will be adopting that.)……..

What you need: bread, eggs, oil or butter (or you can spread mayo over the bread on both sides, which I did last night, and which makes it extra salty and flavorful), salt, pepper. That’s it! (Some parmesan sprinkled over the top is nice, but optional. Next time I make them I may even toss some chopped bacon in there. Might be too much effort, though.)…….

Eggs in the Hole

Makes: 1 to 2 servings
Time: 10 minutes

Ingredients

  • 2 tablespoons butter or olive oil
  • 2–4 eggs
  • 2–4 slices of bread
  • Salt and pepper

Instructions

  1. Put a large skillet over medium heat for about 1 minute. Add the butter or oil and swirl it around the pan.
  2. Use a biscuit cutter or drinking glass to cut a big hole out of the middle of 1 slice of bread for each egg. When the butter foams or the oil is hot, put the bread slices and the circles in the pan (separately) and crack the eggs into the holes. Sprinkle with salt and pepper. When the eggs start to firm up, carefully turn the bread slices and the circles over and cook the other side for a minute or 2, then serve.

--

--