How to use the Null conduction operator in Ruan Yifeng es6.
const firstName = message?.body?.user?.firstName || 'default';
寫(xiě)了這句之后直接編譯出錯(cuò)了。
This syntax is js
的么?感覺(jué)是 coffee
的,即使 js
有,應(yīng)該也得有引入對(duì)應(yīng)的presets
到babel
,es6
好像沒(méi)有這種語(yǔ)法,引入最新的babel preset
Try to see if it can be compiled
Mentioned in the article. "Null Conduction Talisman" is just a proposal. Babel is not displayed yet.