# destructured parameter

{% tabs %}
{% tab title="💈範例" %}
````javascript
/**
 * create an array of numbers
 * ### Examples
 * ```
 * array(5) => [0,1,2,3,4]
 * array(5, {start: 1}) => [1,2,3,4,5]
 * array(3, {start: -1, step: -2}) => [-1, -3, -5]
 * ```
 * ### Parameters
 * @param {number} count - number of elements
 * @param {Object} opts - options
 * @param {number} [opts.start=0] - where to start the array (default: 0)
 * @param {number} [opts.step=1] - the difference between two numbers (default: 1)
 */
export function array(count, { start = 0, step = 1 } = {}) {
  return [...List(count, { start, step })];
}
````
{% endtab %}

{% tab title="📘 手冊" %}
* JSDoc ⟩ [parameters with properties](https://jsdoc.app/tags-param.html#parameters-with-properties) (with optional parameter & default value)
{% endtab %}

{% tab title="👥 相關" %}
* see also: function's [destructured](../../js/val/func/param/destructured "mention").
{% endtab %}
{% endtabs %}
