Wrote debugger logs to see addition reasoning

pull/1899/head
Amir Walker 1 week ago
parent 4e24b845a8
commit c7ae98539c

@ -45,12 +45,18 @@ return min;
function calculateSum(){ function calculateSum(){
let a = 0; let a = 0;
let i = 0;
for (const num of numbers){ for (const num of numbers){
if (num === numbers[0]){ if (num === numbers[0]){
a += num; a += num;
i++;
console.log(`step ${i}: ${a}`);
}else { }else {
a += a + num; a += a + num;
i++;
console.log(`step ${i}: ${a}`);
} }
} }

Loading…
Cancel
Save