// 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
How to implement a linked list using node js |
How to implement a Queue |
Write function to implement FizzBuzz using node js |
How to convert Celsius to Fahrenheit using node js |
Write a function to capitalize the first letter of each word in a sentence using node js |
How to to check if a number is a palindrome using node js |
Find the Maximum Number in an Array |
How to implement a simple calculator using node js |