// 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 function to implement FizzBuzz using node js |
Find the Average of an Array using node js |
How to check if two strings are anagrams |
Find the Maximum Number in an Array |
Write a function to capitalize the first letter of each word in a sentence using node js |
Write to function to calculate the factorial of a number |
what is CI/CD: Github Actions? |
Find the intersection of two arrays using node js |