Want to confirm the correct code for jS data structure and algorithm

Hello!
I am stuck at step 4 of Learn Advance Array Methods for bulilding statistic calculator in javascript data structures and algorithms. I think my code is correct but i am not able to submit it. Can someone suggest me with approach/ correct step ?Thanks in advance.

Please post your actual code instead of a screenshot. Also, please post a link to the step. Thanks

Here is the link and code https://www.freecodecamp.org/learn/javascript-algorithms-and-data-structures-v8/learn-advanced-array-methods-by-building-a-statistics-calculator/step-4

const calculate = () => {
  const value = document.querySelector("#numbers").value;
  const array = value.split(/,\s*/g);
  const numbers= array.map(val=>{return Number(val)});
}

Ok, I don’t understand this step at all, but it wants you to have no arguments to the .map()

Well, the assert message definitely isn’t great.

I get why we might start with the empty map before the next step, although this step does seem a bit superfluous. I do think the requirements and assert message needs to be fixed.

As said, for now it should not have a callback. In the next step, you will add the callback.

Yes, map with no arguments works!Thanks a lot!!

Yes empty map worked!Thanks!!

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