I am trying to understand how to read javascript documentations. Why don't the square brackets close before the commas?
for example
d3.js: selection.style(name[, value[, priority]])
jQuery: $.load( url [, data ] [, complete ] )
I am trying to understand how to read javascript documentations. Why don't the square brackets close before the commas?
for example
d3.js: selection.style(name[, value[, priority]])
jQuery: $.load( url [, data ] [, complete ] )
Square brackets denote optional parts - just imagine drawing a strikethrough line from [ to the nearest ]. So in the jquery example you can omit data or complete or both:
$.load( url
, data, complete ) - ok$.load( url , data
, complete) - ok$.load( url
, data, complete) - ok
In the d3 snippet, if you omit value, you also have to omit priority
selection.style(name
, value, priority) - okselection.style(name, value
, priority) - okselection.style(name
, value, priority) - NOT ok