mirror of
https://github.com/ruanyf/es6tutorial.git
synced 2025-05-27 20:32:21 +00:00
Null 传导运算符提案地址替换为tc39官方
This commit is contained in:
parent
9f82a677ce
commit
78d9b668dd
@ -129,7 +129,7 @@ const firstName = (message
|
||||
&& message.body.user.firstName) || 'default';
|
||||
```
|
||||
|
||||
这样的层层判断非常麻烦,因此现在有一个[提案](https://github.com/claudepache/es-optional-chaining),引入了“Null 传导运算符”(null propagation operator)`?.`,简化上面的写法。
|
||||
这样的层层判断非常麻烦,因此现在有一个[提案](https://github.com/tc39/proposal-optional-chaining),引入了“Null 传导运算符”(null propagation operator)`?.`,简化上面的写法。
|
||||
|
||||
```javascript
|
||||
const firstName = message?.body?.user?.firstName || 'default';
|
||||
|
Loading…
x
Reference in New Issue
Block a user