DEV Community

Discussion on: Optional Chaining in JavaScript Right Now!

Collapse
 
jasonbarry profile image
Jason Barry

I'd lean on the @babel/plugin-proposal-optional-ch... plugin instead – seems a bit safer. Although your method is clever and could be a quick way to get optional chaining if you don't currently have a transpilation step.

Collapse
 
samholmes profile image
Sam Holmes

Yes! This is a solution where you may not be using babel or some other transpiler.