import {reduceComputedPropertyMacro} from '../utils';

/**
*  Returns the product of some numeric properties and numeric constants
*
*  Example: 6 * 7 * 2 = 84
*
*  Usage:
*    a: 6,
*    b: 7,
*    c: 2,
*    d: product('a', 'b', 'c'), // 84
*    e: product('a', 'b', 'c', 2) // 168
*/

export default reduceComputedPropertyMacro(
  function (prev, item) {
    return prev * item;
  }
);

import {reduceComputedPropertyMacro} from '../utils';

/**
  Returns an the multiplication of its arguments.

  Example

  ```javascript
  var obj = Ember.Object.extend({
    a: 6,
    b: 7,
    c: 2,
    d: product('a', 'b', 'c'),      // 84
    e: product('a', 'b', 'c', 2)    // 168
  });
  ```

  @method macros.product
  @param *arguments It can be numbers, property keys containing numbers or other computed properties.
  @return {Number} The product of all its arguments.
*/
export default reduceComputedPropertyMacro(
  function (prev, item) {
    return prev * item;
  }
);

Document `product`