I am trying to create a Random Lottery Number Generator code but I am having issues sorting the numbers from lower to greater. Here is my code of getting the numbers but I can't seem to figure out how to sort them.
function ball(){
let ball = Math.ceil(Math.random() * 70);
console.log(ball);
}
function whiteBalls(){
for(let i = 1; i <= 5; i++){
ball();
}
}
whiteBalls();
I've tried many different ways but keep getting errors. Thank you in advance.