I've been reading a bit of D3s source code and found this interesting pattern in pie.js. After being defined as an "inner function" it has new "methods" added to it before being returned as some kind of hybrid function / object bastard. Can someone explain what is going on here?
https://github.com/mbostock/d3/blob/876e764429bb4c1201b055d8cf7d5d353ed6226c/src/layout/pie.js#L12