Find the Maximum Number in an Array

// Function to find the maximum number in an array
function findMaxNumber(arr) {
  return Math.max(...arr);
}

// Example usage
const numbers = [10, 5, 8, 15, 3];
const maxNumber = findMaxNumber(numbers);
console.log(maxNumber);

 

Post your Answer