const f = ({ a: a = 0, b: b = 1 }) => { ... }
I'm looking for an explanaition to why this doesn't work when I call f()
and it does when I call f({})
.
Main question: Is it possible to have an arrow function with destructured object passed as an argument, with it's properties being given default values if not defined?