r/javascript • • Feb 20 '18

Optional Chaining may be coming to JavaScript

https://dev.to/sammyisa/optional-chaining-may-be-coming-to-javascript--4ff0
321 Upvotes

100 comments sorted by

View all comments

2

u/jpsi314 Feb 20 '18

I agree with others that this kind of code can be a code smell. But I'm often dealing with APIs where fields may or may not be present in which case this operator would be very helpful in reducing clutter.