var aa=[15,65,51,23,46,54,33];function mp(arr){var len=arr.length,temp,j;
while(len>0){
for(j=0;jarr[j+1]){
temp=arr[j];
arr[j]=arr[j+1];
arr[j+1]=temp;
}
}
len--;
}
return arr;
}
console.log("before:\n"+ aa);
console.log("after:\n"+ mp(aa));
var aa=[15,65,51,23,46,54,33];function mp(arr){var len=arr.length,temp,j;
while(len>0){
for(j=0;jarr[j+1]){
temp=arr[j];
arr[j]=arr[j+1];
arr[j+1]=temp;
}
}
len--;
}
return arr;
}
console.log("before:\n"+ aa);
console.log("after:\n"+ mp(aa));