# ARLEN

> Get the highest occupied array index plus one.

Use [ARCOUNT](./arcount) to count stored values.

## Arguments

<ParamField body="key" type="string" required>
  The array key.
</ParamField>

## Response

<ResponseField type="string" required>
  The highest occupied index plus one. A missing key returns `"0"` in TypeScript or `0` in Python. TypeScript returns a string even for small lengths.
</ResponseField>

<RequestExample>
```ts Example
await redis.arset("readings", 1000, "sample");
console.log(await redis.arlen("readings")); // "1001"
console.log(await redis.arcount("readings")); // 1
```
</RequestExample>

See the [server command reference](/redis/commands/array/arlen) for protocol details.
