Skip to content

Commit c4af3b5

Browse files
committed
update
1 parent be057e4 commit c4af3b5

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

arrayMax.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
//How to find a large number from inside an array
2+
let marks = [50, 70, 88, 23, 98, 36, 45, 78, 82]
3+
let max = marks[0];
4+
for (let i = 0; i < marks.length; i++) {
5+
let element = marks[i];
6+
if (element > max) {
7+
max = element;
8+
}
9+
}
10+
console.log(max);

0 commit comments

Comments
 (0)