Hacker News new | past | comments | ask | show | jobs | submit login

From https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe...:

> compareFunction(a, b) must always return the same value when given a specific pair of elements a and b as its two arguments. If inconsistent results are returned then the sort order is undefined.

It doesn't really matter what Math.random() is producing when the sort algorithm is undefined.




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: