> For the complete documentation index, see [llms.txt](https://lochiwei.gitbook.io/web/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://lochiwei.gitbook.io/web/js/val/builtin/arr/ext/arr.copy.md).

# arr.copy()

[JS](/web/js.md) ⟩ [objects](/web/js/val/obj.md) ⟩ [Array](/web/js/val/builtin/arr.md) ⟩ [methods](/web/js/val/builtin/arr/method.md) ⟩ copy()

{% tabs %}
{% tab title="💾 程式" %}

```javascript
// 🔸 arr.copy()
Array.prototype.copy = function(){
    return this.slice();
};
```

{% endtab %}

{% tab title="👥 相關" %}

* [arr.slice()](/web/js/val/builtin/arr/method/arr.slice.md)
  {% endtab %}

{% tab title="🗣 討論" %}

* [Copy array by value](https://stackoverflow.com/a/7486130/5409815)
  {% endtab %}
  {% endtabs %}
