daily pastebin goal
67%
SHARE
TWEET

Untitled

a guest May 16th, 2018 80 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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;
RAW Paste Data
Top