Рет қаралды 3,260
Learn why sorting a list of numbers in javascript yields unexpected results and how to use a compare function. Also, we'll show how the sort function on the Array.prototype might be implemented by re-implementing it our own `Array.prototype.mySort` that accepts our own compare function.
00:00 sort basics
02:00 Implement mySort with the merge sort algorithm
Code
gist.github.com/cjavdev/9fbfc...