Photo by Caroline Attwood on Unsplash.
What's wrong with this code?
Can you find the logical error?
(⚠️ As the tag shows, it's a non-sensical/fun question)
const { flour, eggs, turkey } = groceries
Answer
.
.
.
.
.
.
.
.
You can't cook ingredients (as they are constant thus can't cook them) and have to eat'em raw 😛.
Background Story.
I was chatting with other developers and wanted to make sure if he understood JavaScript Object Destructuring concept correctly.
let { flour, eggs, turkey } = groceries
Someone suggested const
instead of let
promoting a better coding style.
And the first thing popped in my mind was that you can't eat a raw 🦃.
👋 Parting Words
Hope it funny enough 😎.