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

Tell us what’s happening:

I tried various solutions and even found two posts in forum to same question and read all the posts, but could not find solution. I also tried AI and he was wrong too. I tried all combinations, like reversing left and right, trying indexes of array or currentValue…
Btw, I found solution here: https://youtu.be/y_ZlQhEAvHs?t=266
But when I write exactly same code it does not work! Maybe you broken it somehow and nobody can now solve it. Can you try solving it in this moment?

Your code so far

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

/* file: styles.css */

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

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

    while (j >= 0 && array[j] > currValue) {
      array[j+1] = array[j];
      j--;
    }
  }
}

// User Editable Region

Your browser information:

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

Challenge Information:

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

Your solution works from my end. Please try one of the following steps to move forward.

Click on the “Restart Step” button and force a refresh of your page with CTRL + F5 then try to paste the code in again.

or - Try the step in incognito or private mode.

or - Disable any/all extensions that interface with the freeCodeCamp website (such as Dark Mode, Ad Blockers, or Spellcheckers), and set your browser zoom level to 100%. Both of these factors can cause tests to fail erroneously.

or - Ensure your browser is up-to-date or try a different browser.

I hope one of these will work for you.

Thanks, you are right! In incognito it works. Then I tried hard refresh, and it still does not work. Then I tried disabling all extensions, and it works! Then tried enabling extensions one by one, until I figured out which extension is guilty. The one I installed only few days ago, it is Popup Blocker (strict). That is the culprit! Luckily I do not have to remove this extension or disable it completely, it has option when I click on it: just unmark checkbox “Enabled (this domain)”