Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Array.md #504

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions javascript/05_array/Array.md
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ if(someEven){
/*
reduce() 有两个功能,一是可以对数组元素进行求和,二是将数组元素连接成字符串。
*/
fucntion add(num1,num2){
function add(num1,num2){
return num1 + num2;
}
var num = [1,2,3,4];
Expand Down Expand Up @@ -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 个同学的分数为:
Expand Down