Mark As Completed Discussion

In the script above, we declare a sort_arr function which accepts an input array of elements as a parameter. It sorts the array in-place and then returns the number of write operations.

Let's pass it our test array and see the results.

JAVASCRIPT
OUTPUT
:001 > Cmd/Ctrl-Enter to run, Cmd/Ctrl-/ to comment