对象数组
let obj = {
'right_data': [
{ 'time': Number(new Date()) + 1000 * 24 * 60 * 60, 'data': Math.random() * 10 },
{ 'time': Number(new Date()) + 1000 * 24 * 60 * 60 * 2, 'data': Math.random() * 10 },
{ 'time': Number(new Date()) + 1000 * 24 * 60 * 60 * 3, 'data': Math.random() * 10 },
{ 'time': Number(new Date()) + 1000 * 24 * 60 * 60 * 4, 'data': Math.random() * 10 },
{ 'time': Number(new Date()) + 1000 * 24 * 60 * 60 * 5, 'data': Math.random() * 10 },
{ 'time': Number(new Date()) + 1000 * 24 * 60 * 60 * 6, 'data': Math.random() * 10 },
{ 'time': Number(new Date()) + 1000 * 24 * 60 * 60 * 7, 'data': Math.random() * 10 },
{ 'time': Number(new Date()) + 1000 * 24 * 60 * 60 * 8, 'data': Math.random() * 10 }
]
}
Math.max.apply(null, obj.right_data.map(function (o) {return o.time}))
Math.min.apply(null, obj.right_data.map(function (o) {return o.time}))
数组
let arr = [4, 5, 2, 6, 7, 2, 9, 10, 15, 2, 15]
Math.max.apply(null, arr)
Math.min.apply(null, arr)
Math.max(...arr)
Math.min(...arr)