1bubbleSort(Array) {
2 let len = Array.length;
3 for (let i = 0; i < len; i++) { //you can also use "for in", so you don't need the variable "len"
4 for (let j = 0; j < len; j++) {
5 if (Array[j] > Array[j + 1]) {
6 let tmp = Array[j];
7 Array[j] = Array[j + 1];
8 Array[j + 1] = tmp;
9 }
10 }
11 }
12 return Array;
13};