J.P. Morgan interview question

Write a function that uses bubble sort to sort an array