# Paginator

The [`paginate`](/sdks/javascript/ubidots-class/get-methods.md) method returns a `paginator` object with these 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`      |        The number of entity objects on the current page.       |
| `results` | `entityObject[]` |   Contains the `entityObject` instances 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.     |
| `previous` | `paginator` |    Returns a new paginator instance with the `page` property set to the previous page.   |
|  `refresh` | `paginator` | Re-runs the current request and returns an updated paginator object with refreshed data. |


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://dev.ubidots.com/sdks/javascript/ubidots-class/ubidots-objects/paginator.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
