var array = [20.10.30.25.50];
let max = Math.max.apply(null,arr.join(",").split(","));
let min = Math.min.apply(null,arr.join(",").split(","));

console.log(max); / / 50
console.log(min); / / 10
Copy the code