(function () {
const arr = [23, 65, 3, 19, 42, 74, 56, 8, 88];
function findMaxArrValue(arr) {
if (arr.length) {
let max = -Infinity;
for (let num of arr) {
max = num > max ? num : max;
}
return max;
}
return 0; // or any value what you need
}
console.log(findMaxArrValue(arr)); // => 88
})();