Get product of an array using reduce function - Node.js Array

Node.js examples for Array:Array Value

Description

Get product of an array using reduce function

Demo Code

  product: function product_of_array(array)
  {/*from w w  w .jav  a  2  s  . c om*/
    return array.reduce(function(a, b) {
      return a * b;
    });
  },

Related Tutorials