diff --git a/05_sumAll/sumAll.js b/05_sumAll/sumAll.js index 00880c7..92dcc78 100644 --- a/05_sumAll/sumAll.js +++ b/05_sumAll/sumAll.js @@ -1,6 +1,28 @@ -const sumAll = function() { +// First iteration pseudocode: +// Take two arguments. +// Loop between them. +// Store the value +// If negative or or non-number parameters: return ERROR +// +// +// First iteration with a faulty but promosing loop: + +const sumAll = function(x, y) { + let theSum; + for (let i = x; i <=y; i++) { + x += i + } + + console.log(theSum) + }; + +sumAll(1,10) + +// Need to add conditions for ERROR-message + + // Do not edit below this line module.exports = sumAll;