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.
0 parents commit e7bbcd9Copy full SHA for e7bbcd9
maxValue.js
@@ -0,0 +1,11 @@
1
+const maxValue = (nums) => {
2
+ let maximum = -Infinity;
3
+
4
+ for(let num of nums){
5
+ if(num > maximum) maximum = num;
6
+ }
7
8
+ return maximum;
9
+};
10
11
+maxValue([8,2,3,10]) // return 10
0 commit comments