Ad

A function that returns the multiplication of the input arguments. Any number of input arguments can be used.

Code
Diff
  • function multiply(...nums){
      return nums.reduce((acc, num) => acc * num, 1)
    }
    
    • # def multiply (a,b):
    • # return a * b
    • multiply = lambda a, b: a * b
    • function multiply(...nums){
    • return nums.reduce((acc, num) => acc * num, 1)
    • }