FUNCTION: prod( arr )
Computes an array product.

@param {Number[]|Int8Array|Uint8Array|Uint8ClampedArray|Int16Array|Uint16Array|Int32Array|Uint32Array|Float32Array|Float64Array} arr - input array
@returns {Number} product
559509
function prod( arr ) {
	var len = arr.length,
		p = 1,
		i;
	for ( i = 0; i < len; i++ ) {
		if ( arr[ i ] === 0 ) {
			return 0;
		}
		p *= arr[ i ];
	}
	return p;
}
985154
def product(seq):
    
    if len(seq) == 0:
        return 0
    else:
        product = 1
        for x in seq:
            product *= x
        return product
668306
function array_sum (arr) {
		var ans = 0;
		for (k = 0; k < arr.length; k++) {
			ans += arr[k];
		}
		return ans;
	}
164962
function arrayClone(arr) {
        var clone = new Array(arr.length);

        this._forEach(arr, function (el, i) {
            clone[i] = el;
        });

        return clone;
    }
171498
function asArray() {
  var argLen = arguments.length;
  switch(argLen) {
  // No arguments returns an empty array
  case 0:
    return [];
  // Single array argument returns that array
  case 1:
    var arg = arguments[0];
    if (Array.isArray(arg)) {
      return arg;
    }
    // Single object argument returns an array with object as only element
    return [arg];
  // List of arguments returns an array with arguments as elements
  default:
    var args = new Array(argLen);
    for(var i=0; i < argLen; ++i) {
      args[i] = arguments[i];
    }
    return args;
  }
}
632312
function chineseRemainder_bignum(a, n){
  var p = bignum(1);
  var p1 = bignum(1);
  var prod = bignum(1);
  var i = 1;
  var sm = bignum(0);
  for(i=0; i< n.length; i++){
    prod = prod.mul( n[i] );
    //prod = prod * n[i];
  }
  for(i=0; i< n.length; i++){
    p = prod.div( n[i] );

    //sm = sm + ( a[i] * mul_inv(p, n[i]) * p);
    p1 = mul_inv( p, n[i] );
    p1 = p1.mul( a[i] );
    p1 = p1.mul( p );
    sm = sm.add( p1 );
  }
  return sm.mod(prod);
}
786057
function (arr) {
      var r = [];
      var push = function (x) {
        r.push(x);
      };
      for (var i = 0; i < arr.length; i++) {
        arr[i].each(push);
      }
      return r;
    }
505702
function multiply(arr, arg) {
    var row, col, nrescols, sum, nrow, ncol, res, rescols;
    // eg: arr = 2 arg = 3 -> 6 for res[0][0] statement closure
    if (arr.length === undefined && arg.length === undefined) {
      return arr * arg;
    }
    nrow = arr.length,
    ncol = arr[0].length,
    res = jStat.zeros(nrow, nrescols = (isUsable(arg)) ? arg[0].length : ncol),
    rescols = 0;
    if (isUsable(arg)) {
      for (; rescols < nrescols; rescols++) {
        for (row = 0; row < nrow; row++) {
          sum = 0;
          for (col = 0; col < ncol; col++)
          sum += arr[row][col] * arg[col][rescols];
          res[row][rescols] = sum;
        }
      }
      return (nrow === 1 && rescols === 1) ? res[0][0] : res;
    }
    return jStat.map(arr, function(value) { return value * arg; });
  }
244404
public static function productOfArray($array)
    {
        $res = $array[0];

        for ($i = 1; $i < count($array); $i++) {
            $res = $res * $array[$i];
        }

        return $res;
    }
462113
function arraySafeConcat(arr, arg) {
  var result = arrayClone(arr), len = result.length, arr2;
  arr2 = isArray(arg) ? arg : [arg];
  result.length += arr2.length;
  forEach(arr2, function(el, i) {
    result[len + i] = el;
  });
  return result;
}
864361
def _product(*args, **kwds):
    

    pools = map(tuple, args) * kwds.get('repeat', 1)
    result = [[]]
    for pool in pools:
        result = [x+[y] for x in result for y in pool]
    return result
381704
def array(arr, *args, **kwargs):
    '''
    
    '''
    return weldarray(np.array(arr, *args, **kwargs))
572857
def product(sequence, initial=1):
    """"""
    if not isinstance(sequence, collections.Iterable):
        raise TypeError("'{}' object is not iterable".format(type(sequence).__name__))

    return reduce(operator.mul, sequence, initial)
639377
function(arr) {
                var def = Array.isArray;
                return def ? def(arr) : this.type(arr) == TYPES.a;
            }
1175919
function _eachArrayForward(arry, fn) {
  let ret = true
  for (let i = 0; i < arry.length; i++) {
    ret = fn(arry[i], i, arry)
    if (ret === false) {
      break
    }
  }
  return ret
}
631535
private static boolean equal(int[] prod1, int[] prod2) {
        int ofs;

        if (prod1.length != prod2.length) {
            return false;
        }
        for (ofs = 0; ofs < prod1.length; ofs++) {
            if (prod1[ofs] != prod2[ofs]) {
                if (!((prod1[ofs] == prod1[0]) && (prod2[ofs] == prod2[0]))) {
                    return false;
                }
            }
        }
        return true;
    }
714016
function(arr,filterFunc) {
	
	if (arr.filter) { return arr.filter(filterFunc); }
	
	var i = 0,
		l = 0,
		r = [];
	
	for (i = 0, l = arr.length; i < l; i++) {
		if (filterFunc(arr[i])) {
			r.push(arr[i]);
		}
	}
	
	return r;
}