Added power calculator
This commit is contained in:
parent
07d6d7683f
commit
0c51ad1a2b
|
@ -23,8 +23,14 @@ const multiply = function(num1, num2) {
|
|||
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() {
|
||||
|
|
Loading…
Reference in New Issue