How to use the Null conduction operator in Ruan Yifeng es6.
const firstName = message?.body?.user?.firstName || 'default';
写了这句之后直接编译出错了。
高洛峰2017-05-19 10:32:39
This syntax is js
的么?感觉是 coffee
的,即使 js
有,应该也得有引入对应的presets
到babel
,es6
好像没有这种语法,引入最新的babel preset
Try to see if it can be compiled
PHPz2017-05-19 10:32:39
Mentioned in the article. "Null Conduction Talisman" is just a proposal. Babel is not displayed yet.