Skip to content

Param defaults as optional? #64

@codeinabox

Description

@codeinabox

Using the ES6 code for handling defaults and :JsDoc with prompts enabled it generates the following

  /**
   * getChildren
   *
   * @param {int} id
   * @param {int} pageSize=10
   * @param {int} page=1
   * @returns {Promise}
   */
  getChildren(id, pageSize = 10, page = 1) {

However as per the JSDoc documentation, should those params with defaults be listed as optional? ie

  /**
   * getChildren
   *
   * @param {int} id
   * @param {int} [pageSize=10]
   * @param {int} [page=1]
   * @returns {Promise}
   */
  getChildren(id, pageSize = 10, page = 1) {

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions