Jonathan Chan Jonathan Chan - 7 months ago 43
Javascript Question

Document collection (array of type) return value and parameter in JSDoc

How to document

Array
return value (and parameters) in JSDoc when array elements can be either of the following:


  • A type (e.g.
    String
    ,
    Array
    ).

  • An object literal.


Answer

As per doco @returns

/** 
 * @returns {Array} Lines from the file.
 */
function readLines(filepath) {
}

Also see.