const arr = [10, 11, 9]
arr.sort() // it returns [10, 11, 9] because element be covert to string before sorting
arr.sort((a, b) => a - b)) // it returns [9, 10, 11], you MUST SPECIFY THE COMPARE FUNCTION when sorting numbers
const arr = [10, 11, 9]
arr.sort() // it returns [10, 11, 9] because element be covert to string before sorting
arr.sort((a, b) => a - b)) // it returns [9, 10, 11], you MUST SPECIFY THE COMPARE FUNCTION when sorting numbers
| # | User | Rating |
|---|---|---|
| 1 | jiangly | 3810 |
| 2 | Benq | 3676 |
| 3 | Kevin114514 | 3655 |
| 4 | maroonrk | 3463 |
| 5 | strapple | 3447 |
| 6 | Um_nik | 3387 |
| 7 | heuristica | 3322 |
| 8 | turmax | 3317 |
| 9 | tourist | 3307 |
| 10 | jiangbowen | 3291 |
| # | User | Contrib. |
|---|---|---|
| 1 | Qingyu | 156 |
| 2 | nik_exists | 150 |
| 2 | maspy | 150 |
| 4 | Um_nik | 144 |
| 5 | Errichto | 139 |
| 6 | adamant | 137 |
| 7 | AmShZ | 136 |
| 8 | BledDest | 132 |
| 8 | maroonrk | 132 |
| 10 | qwexd | 129 |
| Name |
|---|



Sorry if that comes out harsh, but these 'I wasted 1 hour because ...' posts are pretty much useless. You're expected to read the documentation, and if you had a bug because you don't know or forgot to implement a comparator or something then it's your problem.
If you want to write a post about bugs that would be of use to others, then consider writing one post titled 'Common pitfalls in using JavaScript for competitive programming' with a list of bugs with code samples and explanations.
idk, I feel like not all blogs have to be that useful. this one made me laugh a little, so I thought it was cool