get recursion exponent power in javascript

JavaScript
//get recursion exponent power in javascript
//calcular potencia en javascript
const potenciacion=(base,exponente)=>{
if(exponente==1){
return base;
}
if(exponente==0){
return 1;
}
if(exponente<0){
 exponente*=(-1);
 return 1/(potenciacion(base,exponente-1) * base);
}
return potenciacion(base,exponente-1) * base;
}
console.log(potenciacion(2,2));
Source

Also in JavaScript: