mirror of
https://github.com/ruanyf/es6tutorial.git
synced 2025-05-28 21:32:20 +00:00
commit
4d9b22c6c8
@ -298,7 +298,7 @@ function example(opts) {
|
|||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
上面示例中,参数对象`opts`如果不存在属性`foo`和属性`bar`,则为这两个属性设置默认值。有了“Null 赋值运算符”以后,就可以统一写成下面这样。
|
上面示例中,参数对象`opts`如果不存在属性`foo`和属性`baz`,则为这两个属性设置默认值。有了“Null 赋值运算符”以后,就可以统一写成下面这样。
|
||||||
|
|
||||||
```javascript
|
```javascript
|
||||||
function example(opts) {
|
function example(opts) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user