Now, a quote from my favorite js tutorial thus far: Data Wants to - TopicsExpress



          

Now, a quote from my favorite js tutorial thus far: Data Wants to be Held You may be wondering why you have to write out function(d)... instead of just d on its own. For example, this won’t work: .text("I can count up to " + d); In this context, without wrapping d in an anonymous function, d has no value. Think of d as a lonely little placeholder value that just needs a warm, containing hug from a kind, caring function’s parantheses. (Extending this metaphor further, yes, it is creepy that the hug is being given by an anonymous function — stranger danger! — but that only confuses matters.) Here is d being gently and appropriately held by a function: .text(function(d) { //
Posted on: Wed, 18 Sep 2013 18:08:03 +0000

Trending Topics



Recently Viewed Topics




© 2015