Just like the array destructuring assignment, we can also use the object destructuring assignment as a function parameter. The following example demonstrates this:
function myFunction({name = 'Eden', age = 23, profession = "Designer"} = {}) { console.log(name, age, profession); // Outputs "John 23 Designer" } myFunction({name: "John", age: 23});
Here, we passed an empty object as a default parameter value, which will be used as a default object if undefined is passed as a function argument.