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

Tell us what’s happening:

Could you help me with this exercise? I don’t quite understand what you’re asking me for.

Your code so far

<!-- file: index.html -->

/* file: styles.css */

/* file: script.js */
// User Editable Region

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

// User Editable Region

Your browser information:

El agente de usuario es: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0.0.0 Safari/537.36

Challenge Information:

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

Hi @jordanny17

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

In the second for loop, decrease the array length by one.

Happy coding

2 Likes