i've seen this syntax [,
everywhere and have no idea what it implies.
d3.mean(array[, accessor])
.on( events [, selector ] [, data ], handler )
Why is the comma after the opening bracket? What does it mean?
i've seen this syntax [,
everywhere and have no idea what it implies.
d3.mean(array[, accessor])
.on( events [, selector ] [, data ], handler )
Why is the comma after the opening bracket? What does it mean?
The comma is a separator between parameters. The square brackets mean that the parameter is optional.
So, when you read something like this:
.on( events [, selector ] [, data ], handler )
You can know that you have multiple options of how to call this function:
.on(events, handler)
.on(events, selector, handler)
.on(events, selector, data, handler)
It just means that the parameters are optional.
But be careful! These square brackets
are just used in the documentation.