DEV Community

Omkar Rajan Gaikwad
Omkar Rajan Gaikwad

Posted on

Javascript sorting

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

Top comments (0)

AWS GenAI LIVE image

Real challenges. Real solutions. Real talk.

From technical discussions to philosophical debates, AWS and AWS Partners examine the impact and evolution of gen AI.

Learn more

πŸ‘‹ Kindness is contagious

Please leave a ❀️ or a friendly comment on this post if you found it helpful!

Okay