Functional Programming - Use Higher-Order Functions map, filter, or reduce to Solve a Complex Problem

Everything seems right, my only issue is that my array has spaces on the edges of the array. What’s the best way to fix this.

This is what I have…

const squareList = arr => {
  // Only change code below this line
  let positiveInts = arr.filter(int => int > 0);
  let sqArr = positiveInts.map(int => Math.pow(int, 2))
  return sqArr;
  // Only change code above this line
};

My result is [ 23.04, 25, 9 ]
It should be [23.04, 25, 9]

Please post a link to the challenge. Thanks

I see what you’re saying, thanks for clearing that up I should’ve read it a little deeper.

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