const findMax = (arr)=>{
let max = 0 ;
for (let index = 0; index < arr.length; index++) {
if (max < arr[index] && max != arr[index]) {
max = arr[index];
}
}
return max;
}
//if you find this answer is useful ,
//upvote ⇑⇑ , so can the others benefit also . @mohammad alshraideh ( ͡~ ͜ʖ ͡°)