1
0
mirror of https://github.com/ruanyf/es6tutorial.git synced 2025-05-27 20:32:21 +00:00

Null 传导运算符提案地址替换为tc39官方

This commit is contained in:
yuri 2018-02-25 14:24:17 +08:00 committed by GitHub
parent 9f82a677ce
commit 78d9b668dd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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';