There’s an error when I’m pressing the attempt button: TypeError: array2 is not iterable
However, when I press the test button, it works fine. Why is that?
my code:
function comp(array1, array2) {
let newSecondArr = [];
for (let elements of array2) {
newSecondArr.push(Math.sqrt(elements))
}
return array1.sort((a, b) => a - b).join(',')
=== newSecondArr.sort((a, b) => a - b).join(',')
}