loading...

re: Daily Challenge #225 - Square'n'Sum VIEW POST

TOP OF THREAD FULL DISCUSSION
re: Javascript: const squareSum = numbers => numbers.map(num => num ** 2).reduce((a, b) => a + b, 0)
 

you can actually get rid of the map

const squareSum = arrayOfNumbers => arrayOfNumbers.reduce( (acc, val) => val ** 2 + acc, 0 )
code of conduct - report abuse