function sum(num) { let count = 0; for (i = 1; i <= num; i++) { count = count + i } console.log(count) }