작성
·
201
0
function solution(arr){
let answer = arr;
for(let i=1; i< arr.length;i++){
for(let j=0;j<i;j++){
if(answer[i]<answer[j]){
[answer[i],answer[j]]=[answer[j],answer[i]];
}
}
}
return answer;
}
let arr=[11, 7, 5, 6, 10, 9];
console.log(solution(arr));