Did you know javascript is so amazing, you could sort an array with setTimeout function ?🙄

let arr = [10, 100, 650, 25 , 5, 50];

arr.forEach((item) => {
setTimeout(() => console.log(item), item)
});

// output
5
10
25
50
100
650

Author Of article : Omkar Rajan Gaikwad Read full article