Answers for "how to multiply in a new variable javascript"

6

javascript multiply arguments

const mul = (...args) => args.reduce((a, b) => a * b);

// Example
mul(1, 2, 3, 4);    // 24
Posted by: Guest on July-03-2020
1

multiply js

const multiply = (x,y)=>{
if(x==1){ return y;}
else if(x>1){
return y +multiply(x-1,y)
}
else throw "Not Numbers"
}
var result = multiply(4,3);
console.log(result)
Posted by: Guest on March-06-2021

Code answers related to "how to multiply in a new variable javascript"

Code answers related to "Javascript"

Browse Popular Code Answers by Language