Can someone explain this syntax

I saw this code on stackoverflow about shuffling an array and wondered what it meant

   const someArray = [1, 2, 3, 4, 5];

   someArray.sort(() => Math.random() * 2 - 1);

Thanks

Kirupa wrote about this here: https://www.kirupa.com/html5/arrow_functions.htm

1 Like

Thank you!