---
title: "subarray"
canonical: "https://support.appfire.com/space/PSCONF/15302891/subarray"
format: markdown
---
> Macro (aura-html)

> Macro (table-plus)
> 
> |  |  |  |  |
> | --- | --- | --- | --- |
> | **Syntax** | subarray(arr, start, end) | **Package** | array |
> | **Alias** |  | **Pkg Usage** | subarray(arr, start, end) |

## Description

> Macro (excerpt)
> 
> Returns an array starting with index 'start' and ending at index 'end'.

Returns an array starting with index 'start' and ending at index 'end'.

## Parameters

> Macro (table-plus)
> 
> | Parameter name | Type | Required | Description |
> | --- | --- | --- | --- |
> | arr | Array | Yes | Array. |
> | start | Number | Yes | Start index. |
> | end | Number | Yes | Stop index. |

## Return Type

**Array**

## Example

```javascript
string [] firstFollowers = subarray(watchers, 1, 3); //assume the length of watchers>= 3
```

## See also

> Macro (contentbylabel)