<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
<script>
function sort(arr){
for(i = 0; i <= arr.length - 1; i++){
for(j = 0; j <= arr.length - i - 1; j++){
if(arr[j] > arr[j + 1]){
var temp;
temp = arr[j + 1];
arr[j + 1] = arr[j]
arr[j] = temp;
}
}
}
return arr;
}
console.log(sort([1,10,8,6,9]));
</script>
</head>
<body>
</body>
</html>