Jonathan Chan Jonathan Chan - 9 days ago 5
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.

Comments