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

Merge pull request #774 from Hencky/addlet

add let
This commit is contained in:
Ruan YiFeng 2018-11-24 21:22:20 +08:00 committed by GitHub
commit 840e7ee3a6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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