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

Tell us what’s happening:

I have tried to update the variable to what was requested I obviously didn’t do it properly and am wondering what I missed in the step if it could be clarified or hinted at would be great. The instructions were to update the sortedValues variable by assigning it the result of calling .sort() on the inputValues array.
const sortedValues = insertionSort(inputValues);
inputValues.sort() = sortedValues ;

Your code so far

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

/* file: styles.css */

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

  const sortedValues = insertionSort(inputValues);
   inputValues.sort() =  sortedValues ;
  updateUI(sortedValues);

// User Editable Region

Your browser information:

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

Challenge Information:

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

I would suggest resetting the lesson

This is the line you need to change

specifically this part

instead of calling insertionSort with an argument of inputValues you can use the built in sort method like you did here

essentially the hint could say replace insertionSort(inputValues) with calling the .sort() method on your inputValues array.

or something along those lines.

The hint shouldn’t give the answer outright but try to make it clear that you need to update the existing line and not create a new one

you can suggest changes to curriculum on github here

hope that helps

thank you that makes since, I kept trying to make a new line rather than reset (update) the current line. Much appreciated thanks for the clarity.

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