mirror of
https://github.com/ruanyf/es6tutorial.git
synced 2024-04-21 12:32:22 +00:00
修改let
This commit is contained in:
@@ -375,6 +375,15 @@ var d = new Date(...dateFields);
|
||||
|
||||
上面代码从数据库取出一行数据,通过扩展运算符,直接将其传入构造函数Date。
|
||||
|
||||
除了扩展数组,扩展运算符还可以将一个数值扩展成数值。
|
||||
|
||||
```javascript
|
||||
|
||||
[...5]
|
||||
// [0, 1, 2, 3, 4, 5]
|
||||
|
||||
```
|
||||
|
||||
扩展运算符还可以将字符串转为真正的数组。
|
||||
|
||||
```javascript
|
||||
|
||||
Reference in New Issue
Block a user