From aee0083d76abd3f062c7f73c163406907fe3ca1a Mon Sep 17 00:00:00 2001 From: Tangshucheng Date: Sat, 23 Jan 2021 11:47:02 +0800 Subject: [PATCH] Update Array.md minor --- javascript/05_array/Array.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/javascript/05_array/Array.md b/javascript/05_array/Array.md index d2784d1e..35ef4d1d 100644 --- a/javascript/05_array/Array.md +++ b/javascript/05_array/Array.md @@ -161,7 +161,7 @@ if(someEven){ /* reduce() 有两个功能,一是可以对数组元素进行求和,二是将数组元素连接成字符串。 */ -fucntion add(num1,num2){ +function add(num1,num2){ return num1 + num2; } var num = [1,2,3,4]; @@ -192,13 +192,13 @@ function passing(num){ } var grades = []; for(var i = 0;i < 11;i++){ - grade[i] = Math.floor(Math.random() * 101); + grades[i] = Math.floor(Math.random() * 101); } var pass = grades.filter(passing); console.log("随机产生的 10 个同学的分数为:"); -console.log(grades); +console.log(grades); console.log("及格的分数有:"); -console.log(pass); +console.log(pass); ``` 上述代码的输出结果为 > 随机产生的 10 个同学的分数为: