mirror of
https://github.com/ruanyf/es6tutorial.git
synced 2025-05-25 03:02:21 +00:00
语法错误
// reduce方法 [1,,2].reduce((x,y) => return x+y) // 3 修改后 [1,,2].reduce((x,y) => x+y) // 3
This commit is contained in:
parent
3034d8e4ed
commit
e423f4967f
@ -777,7 +777,7 @@ ES5 对空位的处理,已经很不一致了,大多数情况下会忽略空
|
|||||||
[,'a'].every(x => x==='a') // true
|
[,'a'].every(x => x==='a') // true
|
||||||
|
|
||||||
// reduce方法
|
// reduce方法
|
||||||
[1,,2].reduce((x,y) => return x+y) // 3
|
[1,,2].reduce((x,y) => x+y) // 3
|
||||||
|
|
||||||
// some方法
|
// some方法
|
||||||
[,'a'].some(x => x !== 'a') // false
|
[,'a'].some(x => x !== 'a') // false
|
||||||
|
Loading…
x
Reference in New Issue
Block a user