score:0

Accepted answer

This seems like a straightforward Extract Method refactoring.

var histogSans  = hist(FontSans);
var histogSerif = hist(FontSerif);

function hist(fontName) {
    return d3 .layout.histogram()
              .bins(bin)
              .value(function (d) { return d[SelX]; })
              (fontName);
}

Does that meet your needs?


Related Query

More Query from same tag