diff --git a/calculator/calculator.js b/calculator/calculator.js index d45cc64..f03ea57 100644 --- a/calculator/calculator.js +++ b/calculator/calculator.js @@ -20,6 +20,11 @@ const power = function(a, b) { return Math.pow(a, b); }; +//alternate solution using the Exponentiation operator +const altPower = function(a, b) { + return a ** b; +}; + const factorial = function(n) { if (n === 0) return 1; let product = 1;