๐ What we're MAKING today: My Pizza Recipe
In Opposite Potion you flipped rules with NOT, and in Logic Boss you combined checks with AND and OR.
Today you package those rules into a FUNCTION โ a reusable recipe! ๐ณ
What is a function? It's a named recipe. You write the steps ONCE inside function makePizza(topping) { ... },
then call it by name: makePizza("cheese"). The word in the parentheses โ topping โ is a
parameter: an input slot. Each call can pass a different ingredient (an argument),
and the SAME recipe makes a DIFFERENT pizza! Real apps do this everywhere: one sendMessage(friend) function,
a million messages. One recipe, infinite pizzas! ๐
๐ Last time you used ! to flip a rule. Today you write function makePizza(topping) โ a recipe you can call with makePizza("pepperoni") again and again. The AND/OR/NOT rules live INSIDE the function now, so every pizza you bake follows them automatically! ๐