function solution(unsorted) {
for (let i = 0; i < unsorted.length - 1; i++) {
for (let j = 0; j < unsorted.length - i - 1; j++)
if (unsorted[j] > unsorted[j + 1])
[unsorted[j], unsorted[j + 1]] = [unsorted[j + 1], unsorted[j]];
}
return unsorted;
}
const result = solution([13, 5, 11, 7, 23, 15]);
console.log(result);