Added power calculator

This commit is contained in:
gardenOctopus 2022-11-05 19:36:20 -04:00
parent 07d6d7683f
commit 0c51ad1a2b
1 changed files with 8 additions and 2 deletions

View File

@ -23,8 +23,14 @@ const multiply = function(num1, num2) {
return total; return total;
}; };
const power = function() { const power = function(num, pow) {
let total = 1;
for (i=0; i<pow; i++) {
total *= num;
}
return total;
}; };
const factorial = function() { const factorial = function() {