SOURCE

let arr = [23,123,213,213,123,45,345,46,4,8787,1,2,3,12,1]

function arrSort (arr) {
    for(let i=0;i<arr.length -1;i++){
        for(let j=0;j<arr.length-1-i;j += 1){
            if(arr[j]<arr[j+1]){
                let temp = arr[j]
                arr[j] = arr[j+1]
                arr[j+1] = temp

            }
        }
    }
     return arr



console.log(arrSort (arr))
console 命令行工具 X clear

                    
>
console