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

27

u/beforan Feb 20 '18

So glad to see this. I adopted the c# equivalent so fast when it came out. Plus we use Babel in our workflow where I work so I guess I can use this right now!

11

u/vinnl Feb 20 '18

Plus we use Babel in our workflow where I work so I guess I can use this right now!

But if syntax changes or it even never makes it to the standard as well, you will have to update your codebase.

9

u/[deleted] Feb 20 '18

Small price to pay. In-fact you could probably codemod it out if needs be.

10

u/vinnl Feb 20 '18

If such a codemod is available/you're able/willing to write it yourself. In any case, it's a good thing to be aware of before blindly adopting it - I'm afraid many people aren't afraid what "stage 1" means.

1

u/alchemoria Feb 20 '18

Your slashes are confusing

2

u/vinnl Feb 20 '18

Sorry I know, I wasn't up to spending more time on reworking that comment :P