Skip to content

Instantly share code, notes, and snippets.

@vodori6161
Created February 7, 2023 15:38
Show Gist options
  • Save vodori6161/5f4e1640c719f77c1f34f0118b5ade0f to your computer and use it in GitHub Desktop.
Save vodori6161/5f4e1640c719f77c1f34f0118b5ade0f to your computer and use it in GitHub Desktop.
// Define the recipe steps
const recipeSteps = [
"Step 1: Preheat the oven to 375°F.",
"Step 2: In a large bowl, mix together the flour, sugar, baking powder, and salt.",
"Step 3: In a separate bowl, beat together the eggs and melted butter.",
"Step 4: Add the egg mixture to the flour mixture and stir until well combined.",
"Step 5: Stir in the milk and vanilla extract.",
"Step 6: Pour the batter into a greased 9x13 inch baking dish.",
"Step 7: Bake in the oven for 25-30 minutes or until a toothpick inserted in the center comes out clean.",
"Step 8: Let the cake cool for 5 minutes.",
"Step 9: In a small saucepan, heat the sauce ingredients over medium heat until simmering.",
"Step 10: Pour the sauce over the cake and serve warm."
];
// Define a function to display the recipe steps
function displayRecipe(callback) {
// Display the recipe steps one by one
recipeSteps.forEach((step, index) => {
console.log(`${index + 1}: ${step}`);
});
// Call the callback function
callback();
}
// Call the displayRecipe function and provide a callback function to be executed after the recipe steps have been displayed
displayRecipe(() => {
console.log("Enjoy your delicious cake!");
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment