function max(...rest) {
return rest.reduce((acc, current) => (acc > current ? acc : current), 0);
}
const number = [1, 2, 3, 4, 10, 5, 6, 7];
console.log(max(...number));
function max(...rest) {
return rest.reduce((acc, current) => (acc < current ? acc : current), 0);
}
const number = [1, 2, 3, 4, 10, 5, 6, 7];
console.log(max(...number));