DEV Community

Discussion on: Optional Chaining Has Arrived!

Collapse
 
astuyve profile image
AJ Stuyvenberg

Great article! Coming from a Rails background, I've been really missing the .try method in JS. Happy to see it's finally landed.

That said, it's difficult to discuss optional chaining without talking about the law of demeter, and exactly how much chaining is the right amount.

It's a powerful tool, but it can definitely become overused and cause your application to be brittle!

Collapse
 
rhymes profile image
rhymes

Ruby has optional chaining too, with &., haven't used try in a long time 😊

Take it for a spin!