1
0
mirror of https://github.com/ruanyf/es6tutorial.git synced 2025-05-24 18:32:22 +00:00
This commit is contained in:
Hencky2018 2018-11-22 11:30:44 +08:00
parent 4e13461d83
commit c04151cde4

View File

@ -219,7 +219,7 @@ for (let x of set) {
Set 结构的实例与数组一样,也拥有`forEach`方法,用于对每个成员执行某种操作,没有返回值。
```javascript
set = new Set([1, 4, 9]);
let set = new Set([1, 4, 9]);
set.forEach((value, key) => console.log(key + ' : ' + value))
// 1 : 1
// 4 : 4