📅  最后修改于: 2022-03-11 14:56:25.443000             🧑  作者: Mango
const realNumberArray = [1, 3,-100, 6.7, 55 -47, 68 -3.8]
const squareList = (arr) => {
const squaredIntegers = arr.filter(num => Number.isInteger(num) && num > 0).map(x => x * x)
return squaredIntegers;
};
const squaredIntegers = squareList(realNumberArray);
console.log(squaredIntegers);