var arr = [-1, 1, 101, -52, 10, 1001, 1001]; Math.max(...arr); // 1001
var arr = [-1, 1, 101, -52, 10, 1001, 1001], max; arr.forEach((item, i) => { max = item > arr[i] ? item : arr[i]; }); console.log(max); // 1001
var arr = [-1, 1, 101, -52, 10, 1001, 1001]; arr.sort((a, b) => { return b - a; }); console.log(arr[0]); // 1001
var arr = [-1, 1, 101, -52, 10, 1001, 1001], max = arr.reduce((pre, item) => { return pre > item ? pre : item} ); console.log(max); // 1001