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

### Tell us what’s happening: I tried adding 1 to the length of the array but it does not pass

WARNING

The challenge seed code and/or your solution exceeded the maximum length we can port over from the challenge.

You will need to take an additional step here so the code you wrote presents in an easy to read format.

Please copy/paste all the editor code showing in the challenge from where you just linked.

for (let j = 0; j < array.length; j++){

}

}
}

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36

### Challenge Information:

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

Hi! You didn’t post your code so I cant give you proper help, but this exercise asks you to nest a for loop inside of the current one and to loop through all of the elements except the last one, adding 1 to the length of the array does the opposite of that, you should be removing one not adding.

I believe that you are referring to Step15 with the const bubbleSort variable.
“elements need to compared, a nested ‘for loop’ is needed.
The loop should iterate through every element in the array except the last one.
Use j as the inner loop’s iterator variable.”
If that is correct, then, try this:

}

as the last element in the array should not be included.

for (let j = 0; j < array.length - 1; j++) {
}

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