I’m working through the ES6 challenges, and after much frustration, I took a look at the hints…and I still can’t wrap my head around it fully.
Here’s the solution code, which does indeed pass the tests:
const squaredIntegers = arr.filter( (num) => num > 0 && num % parseInt(num) === 0 ).map( (num) => Math.pow(num, 2) ); return squaredIntegers;
My question is this: what is ‘num’ in this equation? It’s not declared as a variable in the rest of the code, and I can’t find any explanation of it online as a JS component. I’m just starting to get my head around the arrow syntax, but I can’t quite follow the above.