Answer the question
In order to leave comments, you need to log in
Why doesn't this function output an array of positive integers raised to the power of 2?
const squareList = (arr) => {
arr.filter(elem=>
Number.isInteger(elem)&&elem>0)
.map(elem=>Math.pow(elem, 2));
return arr;
};
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question