let stocks = { PancakeIngredients: ["flour", "eggs 🥚", "sugar", "milk🥛", "butter"], liquid: ["water 🥛", "coffee ☕", "wine🍷"], holder: ["frying pan 🍳"], toppings: ["sauce 🥫"], }; let orderPancake = (time, work) => { return new Promise((resolve, reject) => { if (is_pancake_shop_open) { setTimeout(() => { resolve(work()); }, time); } else { reject(console.log("pancake shop closed")); } }); }; orderPancake(2000, () => console.log( `cool! pancake shop is open, let's add some ${stocks.toppings[0]} to give it some unique taste` ) );
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter