Javascript - Destructuring in Function Parameters
📖 Read the lesson
Code Life
By Pierre Marsaa
Unpacking Right in the Parameters
A function that receives an object usually starts by reading a few properties from it. That's repetitive:
↗️
Loading editor...
↶
▶️ Run
↷
You can destructure
in the parameter list itself
. The function then receives the properties directly, already named:
↗️
Loading editor...
↶
▶️ Run
↷
Verify