;
This code creates a list of points, where each point represents a grade. The code then uses the sorted function to determine the grades in order from the lowest to the highest point.
let point;
for(let i=0;i<grades.length;i++){
if(grades[i]>=38 && grades[i]%5>=3){
point = 5 - grades[i]%5;
grades[i] = grades[i]+point;
}else{
grades[i]
}
}
return grades