Last bug: Write Higher Order Arrow Functions

Tell us what’s happening:
All tests pass except the test on the “typeof”

Your code so far


const realNumberArray = [4, 5.6, -9.8, 3.14, 42, 6, 8.34, -2];
const squareList = (arr) => {
  "use strict";
  // change code below this line
  const squaredIntegers = [];
  arr.filter((positiveInteger)=>
  {
    if(positiveInteger>0)
    {
     let isDecimal = false;
     let numb = ''+positiveInteger+'';
     numb = numb.split("");
     numb.filter((placeHolder)=>{
      if(placeHolder == ".")
      {
        isDecimal = true;
      }
    });
    if(isDecimal == false)
    {
     squaredIntegers.push(Math.pow(positiveInteger,2));
    }
  }
  });
  // change code above this line
  return squaredIntegers;
};
// test your code
//const squaredIntegers = squareList(realNumberArray);
//console.log(squaredIntegers);
console.log(squareList(realNumberArray));

Your browser information:

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

Link to the challenge:
https://learn.freecodecamp.org/javascript-algorithms-and-data-structures/es6/write-higher-order-arrow-functions

  return squaredIntegers;

squaredIntegers doesn’t exist on this line.

Can you explain your thinking here, because this code looks very strange at first glance.