We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent be057e4 commit c4af3b5Copy full SHA for c4af3b5
arrayMax.js
@@ -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