4 ms·
I'm looking through the source, specifically the jsDoc comments. Does anybody know what "[v]" means in this context: * @param {function} f function to exe
by euroclydon 15y ago
I'm looking through the source, specifically the jsDoc comments. Does anybody know what "[v]" means in this context:
* @param {function} f function to execute on each value in the array.
* @param [v] object to use as the first argument to the first call of
As I understand it, the parameter type is specified with curly brackets, like, "{function}" in the line above.
- nfriedly 15y ago"v" is the variable name, and the square brackets around it mean it's optional. There is no type specified for this parameter, so nothing in curly brackets.
- euroclydon 15y agoAre these the definitive docs: http://code.google.com/closure/compiler/docs/js-for-compiler.html http://code.google.com/closure/compiler/docs/js-for-compiler... Because I don't see square brackets for optional in there.
- nfriedly 15y agoIt might not be part of the official spec, but it's a convention that we use in my office and I've seen a number of other places as well. [edit] Here we go. This is the JSDoc we use, and presumably Protovis does too. Take a look at the Optional Parameters section: http://code.google.com/p/jsdoc-toolkit/wiki/TagParam http://code.google.com/p/jsdoc-toolkit/wiki/TagParam