DEV Community

Discussion on: Optional Chaining Has Arrived!

Collapse
 
jacobmgevans profile image
Jacob Evans

What do you need to enable it? Just some Babel stuff?

Collapse
 
jacobmgevans profile image
Jacob Evans

Nullish too?

Collapse
 
laurieontech profile image
Laurie

Ya, right now the only way to get the features is Babel. It will be in node soon, but no official announced date.

Thread Thread
 
jacobmgevans profile image
Jacob Evans

Wicked cool!

I also didn't know you could use it on arrays and functions which opens up a whole new world... I don't know how many times I've checked an array to exist and have length before using .map() 😆😅

Collapse
 
seanmclem profile image
Seanmclem

If you're a fan of react it's now part of react scripts 3.3. And in the latest version of vs code it's supported