/* Exercise 7.4: Summation Write a function summation(n) that takes a single argument n, and computes the sum of all integers up to n starting from 0 For example: summation(3) -> 1 + 2 + 3 = 6 Or: summation(7) -> 1 + 2 + 3 + 4 + 5 + 6 + 7 = 28 Use while-loop */ function summation(n) { let count = 1; let sum = 0; while (count <= n) { sum = sum + count; count++; } return sum; } alert(summation(3)); // print out 6 alert(summation(7)); // print out 28 alert(summation(15)); // print out 120 alert(summation(56)); // print out 1596 alert(summation(106)); // print out 5671