function sum(array, fn) {
  fn = fn || func.self;
  return array.reduce(function(memo, v) {
    return memo + fn(v);
  }, 0);
}
get sum from a list

@param {Array} array - array
@param {Function} fn - iterator