---
description: Array is a generic type.
---

# Array\<T>

{% tabs %}
{% tab title="📘 手冊" %}
* TypeScript ⟩&#x20;
  * [Array](https://www.typescriptlang.org/docs/handbook/2/objects.html#the-array-type)
  * [ReadonlyArray](https://www.typescriptlang.org/docs/handbook/2/objects.html#the-readonlyarray-type) ⭐️
{% endtab %}

{% tab title="Second Tab" %}

{% endtab %}
{% endtabs %}

{% hint style="info" %}
* **T\[ ]** : shorthand for **Array\<T>**
* **readonly T\[ ]** : shorthand for **ReadonlyArray\<T>**&#x20;
{% endhint %}

```typescript
interface Array<T> {

  length: number;
 
  // remove last element & returns it.
  pop(): T | undefined;
 
  // append new elements & return new length.
  push(...items: T[]): number;
}
```
