DEV Community

Discussion on: What’s your alternative solution? Challenge #15

Collapse
 
easrng profile image
easrng
const numbers = [-2, 33, 12, -6, -10, 25];

const max = numbers.sort().slice(-1)[0]

console.log(max); // 33