D3.js v4 prepare an object for a Pie Chart

Prepare an array object for a pie chart using d3.pie()(data).value().

   var = data_count = [{
        key: "f",
        value: 2
      },
      {
        key: "m",
        value: 1
      }
    ]

    var arcs = d3.pie()
      .value(function(d) {
        return d.value;
      })
      (data_count);

    arcs.forEach(function(element) {
      console.log(element);
    });

This will generate the array object,

arcs = [
{index: 0, value: 2, startAngle: 0, endAngle: 4.1887902047863905, padAngle: 0},
{index: 1, value: 1, startAngle: 4.1887902047863905, endAngle: 6.283185307179586, padAngle: 0}
]