Array.prototype.bubble = function() {
let _this = this;
for (let i = 0; i < _this.length - 1; i++) {
for (let j = 0; j < _this.length - 1 - i; j++) {
if (_this[j] > _this[j + 1]) {
let temp = _this[j + 1];
_this[j + 1] = _this[j];
_this[j] = temp;
}
}
}
return _this
}
let arr = [4, 56, 1, 89]
console.log(arr.bubble())