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

Tell us what’s happening:

I’ve been stuck on this step for a couple days. I’ve tried every variation of syntax I can think of. I’ve searched MDN and codecademy. Help will be appreciated.

Your code so far

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

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

const updateUI = (array = []) => {
array.forEach(() => {
  (num, i)});
}

// User Editable Region
/* file: styles.css */

Your browser information:

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

Challenge Information:

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

I believe the parameters are in the wrong place. You’ve placed the parameters num and i in the body of the callback function instead of the preceding parantheses, where the parameters should go.

Change

array.forEach(() => {
  (num, i)});

to

and it should work.

Thank you Shady! That was the problem.

1 Like