# Paginator

When invoked, the [`paginate`](https://dev.ubidots.com/sdks/javascript/ubidots-class/get-methods) method returns a `paginator` object with the following properties and methods:

```javascript
{
  next(): `paginator`,
  previous(): `paginator`,
  refresh(): `paginator`,
  page: `int`,
  results: `entityObject[]`,
  size: `int`
}
```

## Paginator object properties

|  Property |       Type       |                          Description                          |
| :-------: | :--------------: | :-----------------------------------------------------------: |
|   `page`  |       `int`      | Represents the current page number in the pagination sequence |
|   `size`  |       `int`      |   Indicates the count of entity objects in the current page.  |
| `results` | `entityObject[]` |    An array of `entityObject` present on the current page.    |

## Paginator object methods

|   Method   |    Return   |                                                     Description                                                    |
| :--------: | :---------: | :----------------------------------------------------------------------------------------------------------------: |
|   `next`   | `paginator` |  Returns a new paginator instance, with the `page` property set to the next page (one ahead of the current page).  |
| `previous` | `paginator` | Returns a new paginator instance, with the `page` property set to the previous page (one behind the current page). |
|  `refresh` | `paginator` |            Re-executes the current request and returns the updated paginator object with refreshed data.           |
