let arr = ['g', 'b', 'c', 'd', 'e', 'a', 'g', 'b', 'c']; // 数组随机排序(原数组被修改)Array.prototype.randomSort = function () { const len = this.length; for (let i = len - 1; i > 1; i--) { let n = Math.floor(Math.random() * i); let lastone = this[i]; this[i] =…