score:0

Accepted answer

When you call a function in d3.js .text its signature is:

.text(function(datum, index){

 });

So:

return "I can count up to " + d + a ; 

means:

return string + datum + index.  

Finally, with Javascript, when you start with a string first, everything is coerced into a string so the d + a concatenates 5 and 0 and then 10 and 1.


Related Query

More Query from same tag