var data = [
{name: "Alice", value: 2},
{name: "Bob", value: 3},
{name: "Carol", value: 1},
{name: "Dwayne", value: 5}
];
var i = d3.scan(data, function(a, b) { return a.value - b.value; }); // 2
//d3对data中的元素两两比较,返回较小的,funtion运行了3+2+1=6次
data[i]; // {name: "Carol", value: 1}
var ticks = d3.ticks(0, 10, 5); // [0, 2, 4, 6, 8, 10]
console.log(ticks)
<script src="https://d3js.org/d3.v4.0.0-alpha.50.min.js"></script>