<<<<<<< HEAD Code Wars - Brett Crafton

Square(n) Sum

Question

Complete the square sum function so that it squares each number passed into it and then sums the results together. For example, for [1, 2, 2] it should return 9 because 1^2 + 2^2 + 2^2 = 9.

No examples

Solution by -

My Solution


	function squareSum(numbers){
		return numbers.reduce((a,b) => a + b*b, 0)
		}
				

Try it yourself - CodeWars

======= Code Wars - Brett Crafton

Square(n) Sum

Question

Complete the square sum function so that it squares each number passed into it and then sums the results together. For example, for [1, 2, 2] it should return 9 because 1^2 + 2^2 + 2^2 = 9.

No examples

Solution by -

My Solution


	function squareSum(numbers){
		return numbers.reduce((a,b) => a + b*b, 0)
		}
				

Try it yourself - CodeWars

>>>>>>> 0e614172debaa009c8d31330edbeb3b765b59c39