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

### Tell us what’s happening:

What am I missing?
I have coded exactly what as per instructions. what am I doing wrong?

### Your code so far

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

``````
``````/* file: styles.css */

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

const selectionSort = array => {
for (let i = 0; i < array.length; i++){
let minIndex = i;

for (let j = i + 1; j < array.length; j++) {
console.log(array, array[j], array[minIndex],);
if (array[j] < array[minIndex]) {
minIndex = j;
}
}
const temp = array[i];
array[i] = array[minIndex];
array[minIndex] = temp;
}
return array;
}

// User Editable Region
``````

### Your browser information:

User Agent is: `Mozilla/5.0 (X11; CrOS x86_64 14541.0.0) 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 30

You made a change on this line, which is breaking your code

OMG, you’re a life saver. Thanks buddy