From e423f4967f90df64fc15db219397b233224cc54b Mon Sep 17 00:00:00 2001 From: leolcy <406131001@qq.com> Date: Tue, 24 Jul 2018 18:10:53 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AF=AD=E6=B3=95=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit // reduce方法 [1,,2].reduce((x,y) => return x+y) // 3 修改后 [1,,2].reduce((x,y) => x+y) // 3 --- docs/array.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/array.md b/docs/array.md index 7f6fd37..a751516 100644 --- a/docs/array.md +++ b/docs/array.md @@ -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