Skip to content

Commit a83ee5b

Browse files
authored
Update functionalty.js
1 parent 33125c6 commit a83ee5b

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

functionalty.js

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,19 @@ function descending(array) {
2323
function minArray(array) {
2424
let min = null;
2525
for (let i = 0; i < array.length; i++) {
26-
min == null ? min = array[i]:
26+
min == null ? min = array[i] : "";
27+
array[i] < min ? min = array[i] : "";
2728
}
29+
return min;
30+
}
31+
32+
function maxArray(array) {
33+
let max = null;
34+
for (let i = 0; i < array.length; i++) {
35+
max == null ? max = array[i] : "";
36+
array[i] > max ? max = array[i] : "";
37+
}
38+
return max;
2839
}
2940

3041
// Strings

0 commit comments

Comments
 (0)