diff --git a/calculator/calculator.js b/calculator/calculator.js index d45cc64..a18a527 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 Exponentiation opertator +const power = function(a, b) { + return a ** b; +}; + const factorial = function(n) { if (n === 0) return 1; let product = 1;