DEV Community

Discussion on: Make your function calls more readable

Collapse
hamatti profile image
Juha-Matti Santala Author • Edited

I agree that the syntax for that is really confusing. Every time I write it, I have to check to make sure I'm putting things in the right place.

It gets even more confusing when you also rename properties:

const { foo: bar = 120 } = baz

What it does is essentially:

const bar = baz.foo === undefined : 120 ? baz.foo