Learn Basic Algorithmic Thinking by Building a Number Sorter - Step 15

Tell us what’s happening:

Sorry, your code does not pass. Keep trying.

Your inner for loop should iterate through every element in the array except the last one.

Your code so far

const bubbleSort = (array) => {
  for (let i = 0; i < array.length; i++) {
    for (let j = 0; j < array[i].length - 1; j++){
      
    }
  }
}

Your browser information:

User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/122.0.0.0 Safari/537.36

Challenge Information:

Learn Basic Algorithmic Thinking by Building a Number Sorter - Step 15

Your inner for loop should iterate the same array as your outer for loop (i.e. a nested for loop but not a nested array).

1 Like

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.