Remove a console.log and correct the sort function to be compatible with otherbrowsers