17 lines
232 B
JavaScript
17 lines
232 B
JavaScript
function plus(a,b) {
|
|
for (let i=0; i < a; i++){
|
|
b++;
|
|
}
|
|
return b;
|
|
}
|
|
|
|
function mult(a,b) {
|
|
sum=0;
|
|
for(let i=0; i < a; i++) {
|
|
sum = plus(sum, b)
|
|
}
|
|
return sum;
|
|
}
|
|
|
|
exports.plus = plus;
|
|
exports.mult = mult; |