I'm having a hard time understanding the else block. I know it's supposed to raise the base parameter to the exponent parameter. But how does it work?
var power = function(base, exponent){
if (exponent === 0){
return 1;
}
else{
return base * power(base, exponent - 1);
}
};
power(2, 2);