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

后端 未结 5 1401
甜味超标
甜味超标 2020-12-08 14:30

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

  • A type (e.g. String,
5条回答
  •  粉色の甜心
    2020-12-08 15:04

    Although you may find that the guidance given in some of the other answers works for you, I prefer this syntax:

    /**
     * @return {Array} ...
     */
    

    And in comparison to the guidance others have offered, I think this is closer to your expectation based on the example you give in your question.

    Here's great source for information on JSDoc: https://wiki.servoy.com/display/public/DOCS/JSDoc+Annotations

提交回复
热议问题