var arr = [5,4,3,2,1]
function fn(){
for(var i = 0;i<arr.length-1;i++{
for(var j = 0;j<arr.length-1;j++{
if(arr[j]>arr[j+1]){
var x = arr[j];
arr[j]=arr[j+1];
arr[j+1] = x }
}
}
console.log(arr)
var arr = [5,4,3,2,1]
function fn(){
for(var i = 0;i<arr.length-1;i++{
for(var j = 0;j<arr.length-1;j++{
if(arr[j]>arr[j+1]){
var x = arr[j];
arr[j]=arr[j+1];
arr[j+1] = x }
}
}
console.log(arr)