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

18

u/[deleted] Feb 20 '18 edited Feb 20 '18

I need this in my life today. I'd say undefined is the biggest annoyance and probably the only major one remaining I have with Javascript. Currently using lodash get for this purpose.

Edit: wanted to expand why lodash get is not good enough for me. I don't mind using library but lodash get doesn't work with TypeScript well.

3

u/calligraphic-io Feb 20 '18

Have you looked at using algebraic data types, like Sanctuary.js?

3

u/[deleted] Feb 20 '18

No.

0

u/0987654231 Feb 20 '18

It's worth looking at, algebraic data types(ADTs) can be a powerdul too.