Addepar interview question

On a sorting algorithm, we need to create a visual representation of the sorting algorithm in JS, where after each second we should see the elements shuffling in the array, and finally the sorted array.