Sha256: 01f937858f7df8b887fa6461c101c568cc2256aa08c45ca0d19a0b5bd52fcba8

Contents?: true

Size: 346 Bytes

Versions: 1

Compression:

Stored size: 346 Bytes

Contents

import "../math/number";

d3.sum = function(array, f) {
  var s = 0,
      n = array.length,
      a,
      i = -1;
  if (arguments.length === 1) {
    while (++i < n) if (d3_numeric(a = +array[i])) s += a; // zero and null are equivalent
  } else {
    while (++i < n) if (d3_numeric(a = +f.call(array, array[i], i))) s += a;
  }
  return s;
};

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
mdarray-sol-0.1.0-java node_modules/dc/node_modules/d3/src/arrays/sum.js