Skip to content

Commit

Permalink
Fix typo.
Browse files Browse the repository at this point in the history
  • Loading branch information
kxxoling committed May 21, 2018
1 parent 47bffce commit c09cbaf
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions js/py-es6.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ i // 2
```js
// ES6
var arr = [1,2];
for (var i = 0; i < arr.length; i++) {}
for (let i = 0; i < arr.length; i++) {}
i // ReferenceError: i is not defined
```

Expand Down Expand Up @@ -114,7 +114,7 @@ let arrayLike = {
let arr2 = Array.from(arrayLike); // ['a', 'b', 'c']

// ES5 中只能这样:
var arr1 = [].slice.call(arrayLike);
var arr1 = [].slice.call(arrayLike);
```

ES5 中数组创建方法的行为一直不统一,因此提供了 ``Array.of`` 来创建新数组:
Expand Down

0 comments on commit c09cbaf

Please sign in to comment.