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

**URL:** <https://forum.freecodecamp.org/t/learn-basic-algorithmic-thinking-by-building-a-number-sorter-step-7/679346>\
**Category:** Curriculum Help\
**Tags:** javascript\
**Created:** [March 14, 2024, 12:07am UTC](https://forum.freecodecamp.org/t/learn-basic-algorithmic-thinking-by-building-a-number-sorter-step-7/679346 "2024-03-14T00:07:43Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![coloradoz99](https://avatars.discourse-cdn.com/v4/letter/c/5e9695/32.png) [@coloradoz99](https://forum.freecodecamp.org/u/coloradoz99)\
**Post date:** [March 14, 2024, 12:07am UTC](https://forum.freecodecamp.org/t/learn-basic-algorithmic-thinking-by-building-a-number-sorter-step-7/679346/1 "2024-03-14T00:07:43Z")

</div>

### Tell us what’s happening:

`auto coder is say map should take in dropdown param There has been no step to declare that variable. `

### Your code so far

```auto
const sortInputArray = (event) => {
  event.preventDefault();

  const inputValues = [...document.getElementsByClassName("values-dropdown")].map(() => {
    inputValues.value;
  });
}

```

WARNING

The challenge seed code and/or your solution exceeded the maximum length we can port over from the challenge.

You will need to take an additional step here so the code you wrote presents in an easy to read format.

Please copy/paste all the editor code showing in the challenge from where you just linked.

````plaintext
Replace these two sentences with your copied code.
Please leave the ``` line above and the ``` line below,
because they allow your code to properly format in the post.

````

### Your browser information:

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

### Challenge Information:

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

> **[freeCodeCamp.org](https://www.freecodecamp.org/learn/javascript-algorithms-and-data-structures-v8/learn-basic-algorithmic-thinking-by-building-a-number-sorter/step-7)**
>
> Learn to Code — For Free

---

<div class="post-metadata">

**Author:** ![jwilkins.oboe](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/jwilkins.oboe/32/179497_2.png) [@jwilkins.oboe](https://forum.freecodecamp.org/u/jwilkins.oboe)\
**Post date:** [March 14, 2024, 12:36am UTC](https://forum.freecodecamp.org/t/learn-basic-algorithmic-thinking-by-building-a-number-sorter-step-7/679346/2 "2024-03-14T00:36:35Z")

</div>

> [@coloradoz99](#):
>
> There has been no step to declare that variable.

you are not declaring a variable here.  
The lesson wants you to add a parameter of dropdown to your callback function.

here is another example

here is a list of numbers

```js
const numbers = [1,2,3,4]

```

if I wanted to chain the map method to the numbers array and double their amount, then I can pass in a callback with a parameter of num

```js
const numbers = [1, 2, 3, 4].map(num => num * 2);

```

`num` is the parameter name in that example. You need to do something similar for this challenge.

`inputValues` is an array.

your `map`’s callback function should have a parameter called dropdown and you should implicity return `Number(dropdown.value)`

hope that helps

---

<div class="post-metadata">

**Author:** ![coloradoz99](https://avatars.discourse-cdn.com/v4/letter/c/5e9695/32.png) [@coloradoz99](https://forum.freecodecamp.org/u/coloradoz99)\
**Post date:** [March 14, 2024, 12:43am UTC](https://forum.freecodecamp.org/t/learn-basic-algorithmic-thinking-by-building-a-number-sorter-step-7/679346/3 "2024-03-14T00:43:28Z")

</div>

That is very helpful ! Thankyou

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/freecodecamp/original/3X/e/1/e1c433102e34b46dfaa3e15d13ab9a514b127078.svg) [@system](https://forum.freecodecamp.org/u/system)\
**Post date:** [September 12, 2024, 12:44pm UTC](https://forum.freecodecamp.org/t/learn-basic-algorithmic-thinking-by-building-a-number-sorter-step-7/679346/4 "2024-09-12T12:44:12Z")

</div>

Closed on September 12, 2024, 12:44pm UTC

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