1
0
mirror of https://github.com/ruanyf/es6tutorial.git synced 2025-05-24 18:32:22 +00:00

Merge pull request #728 from LeoLcy/patch-1

语法错误,箭头函数单行不需要return
This commit is contained in:
Ruan YiFeng 2018-07-25 07:41:44 +08:00 committed by GitHub
commit 7c49f7edc2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -777,7 +777,7 @@ ES5 对空位的处理,已经很不一致了,大多数情况下会忽略空
[,'a'].every(x => x==='a') // true
// reduce方法
[1,,2].reduce((x,y) => return x+y) // 3
[1,,2].reduce((x,y) => x+y) // 3
// some方法
[,'a'].some(x => x !== 'a') // false