logo Practice-It logo

sumUpTo

Language/Type: JavaScript parameters
Author: Melissa Medsker-Galloway (on 2016/11/18)

Write a function named sumUpTo that accepts an integer parameter n and returns the sum of the integers from 1 through n inclusive. For example, sumUpTo(5) returns 15, since 1 + 2 + 3 + 4 + 5 = 15. You may assume that the value of n is at least 1.

Type your solution here:


This is a function problem. Write a JavaScript function as described. Do not write a complete program; just the function(s) above.

You must log in before you can solve this problem.


Log In

If you do not understand how to solve a problem or why your solution doesn't work, please contact your TA or instructor.
If something seems wrong with the site (errors, slow performance, incorrect problems/tests, etc.), please

Is there a problem? Contact a site administrator.