mirror of
https://github.com/ruanyf/es6tutorial.git
synced 2025-05-25 03:02:21 +00:00
Merge pull request #277 from LcpMarvel/change_description_about_shorthand_properties
修改"属性的简洁表示法"描述
This commit is contained in:
commit
19bb7ad9de
@ -13,7 +13,7 @@ baz // {foo: "bar"}
|
||||
var baz = {foo: foo};
|
||||
```
|
||||
|
||||
上面代码表明,ES6允许在对象之中,只写属性名,不写属性值。这时,属性值等于属性名所代表的变量。下面是另一个例子。
|
||||
上面代码表明,ES6允许在对象之中,直接写变量。这时,属性名为变量名, 属性值为变量的值。下面是另一个例子。
|
||||
|
||||
```javascript
|
||||
function f(x, y) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user