JavaScript sorting of array of numbers

preview_player
Показать описание
🔸 default sort doesn't work as expected with numbers. It converts number to a string before sorting
🔹 we can pass compare function to sort numbers daily
🔸 using Math random & compare function we can create a shuffled array

Follow @profulsadangi on twitter for daily updates
Рекомендации по теме
Комментарии
Автор

I learned how to sort numbers but didn't quite catch how it happens. Wish it had more step by step explanation on why comparing method works. Thanks tho

prabhakaranjeyamohan
Автор

can you tell me which application is used to make this code presentation ?

sharaths
join shbcf.ru