Answers for "javascript object as parameters"

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

object as a parameter in javascript

var fac = function me(n) {
    if (n > 0) {
        return n * me(n-1);
    } else {
        return 1;
    }
};
console.log(fac(3)); // 6
Posted by: Guest on January-28-2021

Code answers related to "javascript object as parameters"

Code answers related to "Javascript"

Browse Popular Code Answers by Language