DEV Community

Discussion on: Optional Chaining may be coming to JavaScript

Collapse
 
sammyisa profile image
Sammy Israwi

Why do you think so? I agree that the syntax right now is not great, and that it needs some tweaking. But overall it seems like a nice Quality Of Life improvement on the language.

Collapse
 
inf3rno profile image
inf3rno • Edited

You might be right. I just watch it from a different perspective than you. I would write if(specimen instanceof Alien) where you write if(specimen && specimen.arms && specimen.arms.length > 2). But I can accept that many devs are working with structured code, so this new feature will be fine for them. I might use it rarely too by processing nested config objects.