From 7c75fa1d4a369e0249f7070bbe366117b7ae3311 Mon Sep 17 00:00:00 2001 From: George Mihov <53583283+gmihov001@users.noreply.github.com> Date: Wed, 1 Sep 2021 12:11:44 -0400 Subject: [PATCH] Update README.md --- exercises/08.3-Sum-all-items/README.md | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/exercises/08.3-Sum-all-items/README.md b/exercises/08.3-Sum-all-items/README.md index 0442a3a6..8add5398 100644 --- a/exercises/08.3-Sum-all-items/README.md +++ b/exercises/08.3-Sum-all-items/README.md @@ -2,7 +2,7 @@ ## :pencil: Instructions: -Using a `for` loop, complete the code of the function `sum` so that it returns the sum of all the items in a given array, for example: +Using a `for` loop, complete the code of the function `sumTheElements` so that it returns the sum of all the items in a given array, for example: ```js console.log(sumTheElements([2,13,34,5])) @@ -11,14 +11,16 @@ console.log(sumTheElements([2,13,34,5])) ### Expected result: -925960 +`925960` # :bulb: Hint: + Initilize a variable `total` at 0. -+ Loop the entire array. ++ Call the function with any array of numbers that add up to the expected result above. + ++ Loop the entire array inside of the function. + On every loop add the value of each item into the `total` variable. -+ Return the `total` variable (outside of the loop but inside of the function). \ No newline at end of file ++ Return the `total` variable (outside of the loop but inside of the function).