Merge pull request #218 from trekitch/jest-solutions
This commit is contained in:
commit
d1c9c98366
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue