mirror of
https://github.com/10h30/odin-javascript-exercises.git
synced 2026-06-05 15:09:09 +09:00
Update calculator-solution.js
This commit is contained in:
@@ -11,12 +11,12 @@ const sum = function (array) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const multiply = function(...args){
|
const multiply = function(...args){
|
||||||
let sum = 1
|
let product = 1;
|
||||||
for (let i = 0; i < args.length; i++) {
|
for (let i = 0; i < args.length; i++) {
|
||||||
sum *= args[i]
|
product *= args[i];
|
||||||
}
|
}
|
||||||
return sum
|
return product;
|
||||||
}
|
};
|
||||||
|
|
||||||
const power = function (a, b) {
|
const power = function (a, b) {
|
||||||
return Math.pow(a, b);
|
return Math.pow(a, b);
|
||||||
|
|||||||
Reference in New Issue
Block a user