1

Some time ago, I asked a question on Stack Overflow about sorting an array with JavaScript reduce function. And many kind users answer my question and I got some ideas about implementing a sorting algorithm with reduce function.

Actually, In my newest project, I have a big array that should be sort as fast as could happen ever. I implement some algorithms but I think I do not use JavaScript functions truly. I read some articles in medium and one of them is this article. I don't seek for a high-performance algorithm for sorting. Just like the article said, there is no fast way faster than nLog(n). I seek a real fast implementation in execution.

Is there a JavaScript built-in function for this or do you know an awesome sorting implementation for sorting big scale arrays?

AmerllicA
  • 29,059
  • 15
  • 130
  • 154

1 Answers1

0
   const array1 = [1, 30, 4, 21, 100000];
   array1.sort();
   array1.sort(function sortFunction() {...})

More info:

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort

mjs
  • 21,431
  • 31
  • 118
  • 200