Null Propagation (Conditional) Operator Syntax Support for Javascript

Viewed 741

Does anybody know how to handle Null Propagation (Conditional) Operator syntax support for Javascript language (al least to turn off warnings)?

enter image description here

Maybe settings? Or plugins?

1 Answers

Current JavaScript engines to my knowledge do not support this. However, a proposal has been made to introduce this into the language: Optional Chaining for JavaScript

For the time being you could use the Babel Plugin mentioned in the proposal: @babel/plugin-proposal-optional-chaining. The plugin together with Babel itself will transpile your code to something that can be used with current engines.

However, I don't know about visual studio support.

Related