I can not understand why it turns out 8? How does the program work? What are you doing? Into a stupor enters the 3rd line return 1; Why won't just the number 1 return?)
function power(base, exponent) { if (exponent == 0) return 1; else return base * power(base, exponent - 1); } console.log(power(2, 3));