Currently learning Javascript and I'm facing a challenge in an exercise from a tutorial, think it was learn street.com... The task is to sort an array of numbers without using the sort() method. Array looks like this:
numbers =[12,10,15,11,14,13,16];
I've been trying different approaches since morning but still haven't cracked it. Can anyone provide some guidance? Detailed explanations are appreciated along with the solution!
Thank you
Here's where I'm at right now:
function order(list){
var result=[];
for(i=0; i<list.length; i++){
for(j=0; j<list.length; j++){
if(list[i]>list[j+1]){
}
}
}
console.log( result );
}
order(numbers);