this code finds the max element in an array using the reduce command.
function getMaxY(){
return data.reduce((max, b) => Math.max(max, b.y), data[0].y);
}
this code finds the max element in an array using the reduce command.
function getMaxY(){
return data.reduce((max, b) => Math.max(max, b.y), data[0].y);
}