export function getMaxSpeed(data:any[]){
    let sortSpeedData = JSON.parse(JSON.stringify(data)).sort((a,b)=>{return (b.speed || 0) - (a.speed||0)})
    return ((sortSpeedData[0]||{}).speed || 0)
}

export function getAvgSpeed(data:any[]){
    if(data.length === 0){
        return 0
    } else {
        return ((data.map(item=>item.speed || 0).reduce((prev,cur)=>{
            return prev + cur
        },0) / data.length))
    }
}
