function bubbleSort(arr) {
let n = arr.length;
for (let i = 0; i < n-1; i++) {
for (let j = 0; j < n-i-1; j++) {
if (arr[j] > arr[j+1]) {
// Échangez arr[j+1] et arr[j]
let temp = arr[j] ;
arr[j] = arr[j+1];
arr[j+1] = temp;
let arr = [64, 34, 25, 12, 22, 11, 90];
console.log("Le tableau avant le tri est : "
console.log(arr.join (" ")
arr = bubbleSort(arr);
console.log("Le tableau trié est : "
console.log(arr.join(" "));