Guest User

Untitled

a guest
May 16th, 2018
140
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.17 KB | None | 0 0
  1. function sum(fromN, toN) {
  2. // Sum all the values from fromN up to toN
  3. if (fromN === toN){
  4. return toN;
  5. }
  6. return fromN + sum(fromN + 1, toN);
  7. }
  8.  
  9. module.exports = sum;
Add Comment
Please, Sign In to add comment