Ad
Code
Diff
  • const power = (a, b) => a === 0 ? 1 : a ** b;
    • // why not ?
    • function power(a, b){
    • // if (a === 0){
    • // return 1
    • // } else {return(a ** b)}
    • return a ** b;
    • }
    • const power = (a, b) => a === 0 ? 1 : a ** b;