lorenzodyce
9/28/2018 - 10:14 PM

Sum-From-a-to-b-Recursively.js


function sum(a, b) {
  if (a === b) {
    return b;
  }
  return a + sum(a + 1, b);
}

console.log(sum(3, 7));