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);