How is an array sorted using the quicksort algorithm in typescript or javascript?

This is one of the most famous question asked during interviews. I have suggested the following typescript / relevant javascript solution:

Pretty cool right?

This is published as an npm package too