javascriptvisualizer icon indicating copy to clipboard operation
javascriptvisualizer copied to clipboard

Throws Error - white screen

Open dostarora97 opened this issue 3 years ago • 0 comments

Throws error when running this code. And screen becomes blank

function createAdder(baseNumber) {
  return function(otherNumber) {
    if (otherNumber <= baseNumber) {
      return otherNumber + baseNumber;
    } else {
      return createAdder(otherNumber + baseNumber);
    }
  }
}

let result = createAdder(1)(3)(5)(0);
console.log(result);

Expected output is 9

dostarora97 avatar Apr 16 '22 09:04 dostarora97