I want to ask about the return type of variables/functions. I have some sample code like this:
var randomX = d3.randomNormal(mean, 80),
randomY = d3.randomNormal(mean, 80),
points = d3.range(1000).map(function() {return [randomX(), randomY()]; });
randomX
and randomY
were declared as variables, why in the return
line they were randomX()
and randomY()
with the parentheses?
I'm new to Javascript, please help me out here. Thank you in advance!