Difference between sort(), sort(function(a,b){return a-b;}); and sort(function(a,b){…})

后端 未结 4 603
醉梦人生
醉梦人生 2021-02-02 03:12

I am trying to understand how exactly sort() works and how I am supposed to use it.

I did some research (google) and went through the similar questions here on stackover

4条回答
  •  滥情空心
    2021-02-02 03:57

    Ok, so after some additional research, going through the MDN documentation, and the arraysort and arraysort2 links, which I found very helpful, I created a slide that could probably be of use to someone else, so I am posting it here. Thank you all for your answers!

提交回复
热议问题