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

Tell us what’s happening:

I’ve created the variable sortedValues and assigned it to bubbleSort, followed by updateUI(sortedValues). I tried inputValues.bubbleSort and inputValues[bubbleSort], but neither option worked.

Your code so far

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

/* file: styles.css */

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

  const sortedValues = bubbleSort;
  updateUI(sortedValues);

// 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/124.0.0.0 Safari/537.36

Challenge Information:

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

Isn’t bubbleSort a function. To invoke functions you need to use parentheses. Also, doesn’t bubbleSort take an argument? Look at how you defined it below. What should you pass into it?

bubbleSort is a function and it should take inputValues as an argument. Now I finally got it.

1 Like