score:3

This piece of code is incorrect:

.outerRadius(innerRadius + function(d, i) {return cities[i].conservation;})

You are trying to sum innerRadius + reference to function. function(d, i) {return cities[i].conservation;} is only a pointer reference to this function not a function call. This function is not called directly, it is only passed as argument to outerRadius which executes it later. In your example, there is called innerRadius + function(d, i) {return cities[i].conservation;}. They are of incompatible types (innerRadius is maybe integer and function(... is of type function) so there is called method .toString() and you pass the string "100function (d, i) {return cities[i].conservation;}" to .outerRadius where 100 is value of innerRadius variable. The code should be:

.outerRadius(function(d, i) {return innerRadius + cities[i].conservation;})

Related Query