FFIND MAX ELEMENT IN ARAAY
function findMax(arr) {
let max = arr[0]; // Initialize max with the first element of the array
for (let i = 1; i < arr.length; i++) {
if (arr[i] > max) {
max = arr[i];
}
}
return max;
}
const arr=[3, 8, 1, 9, 5];
...