From ade6be6cd7ecef2a4277655ba40c01e7e2091629 Mon Sep 17 00:00:00 2001 From: Angelos Chalaris Date: Tue, 16 Oct 2018 13:55:06 +0300 Subject: [PATCH] Update squareSum.md --- snippets_archive/squareSum.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/snippets_archive/squareSum.md b/snippets_archive/squareSum.md index b56f180ed..326504b40 100644 --- a/snippets_archive/squareSum.md +++ b/snippets_archive/squareSum.md @@ -2,8 +2,7 @@ Squares each number in an array and then sums the results together. -Use `Array.prototype.reduce()` to iterate over numbers and to declare an accumulator. -Use `Math.pow()` to calculate power of each number and add all numbers into acculmulator. +Use `Array.prototype.reduce()` in combination with `Math.pow()` to iterate over numbers and sum their squares into an accumulator. ```js const squareSum = (...args) => args.reduce((squareSum, number) => squareSum + Math.pow(number, 2), 0);