daily pastebin goal
3%
SHARE
TWEET

Untitled

a guest May 16th, 2018 81 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
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top