JavaScript - Looping assignment 1: Sum of all natural numbers till the input