Valeo Interview Question

I was asked to write a function to sort values in an array in ascending/descending order.