Skip to content

Latest commit

 

History

History
17 lines (11 loc) · 287 Bytes

File metadata and controls

17 lines (11 loc) · 287 Bytes

Add up to

Instructions

Given positive integer n implement a function which calculates sum of all numbers from 1 up to (and including) number n.

challenge | solution

Examples

addUpTo(1) // 1

addUpTo(2) // 3

addUpTo(3) // 6