This is an exercise to solve the classic problem of sorting the elements of an array. The added twist is that this solution uses asynchronous functions to sort the array from both directions simultaneously. One thread sorts elements from the lowest value up, and another thread sorts the elements from the highest value down.
I coded this project as part of a Follow the Pattern course.
To create and sort an array, follow these steps:
- Create a copy of the file
source/main.js
, and open it with your text editor. - At the bottom of the file, delete the example.
- Call the
generateAndSortArray
function, specifying the number of elements in the generated array as its parameter.
As a result, you have created and sorted an array.