[Home] >  Array >  Find the maximum item of an array

Find the maximum item of an array

JavaScript version

const max = (arr) => Math.max(...arr);

TypeScript version

const max = (arr: number[]): number => Math.max(...arr);