// 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);
// 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);
Related
Write to function to calculate the factorial of a number |
what is CI/CD: Github Actions? |
Write a function to check if a number is prime using node js |
Write program to remove duplicates from an Array |
How to check if two strings are anagrams |
How to convert Celsius to Fahrenheit using node js |
How to implement a Stack using node js |
Find the intersection of two arrays using node js |
