# count

## Description

Counts the number of elements in an array. An array can be created using the toArray function.

## Input / Parameter

| Name   | Description          | Input Type | Default | Options | Required |
| ------ | -------------------- | ---------- | ------- | ------- | -------- |
| values | The array of values. | Array/List | -       | -       | Yes      |

## Output

| Description                                        | Output Type |
| -------------------------------------------------- | ----------- |
| Returns the total number of elements in the array. | Number      |

## Callback

N/A

## Video

Coming Soon.

## Example

The user wants to count all the data in an array.

### Step

1. Call the function "count".

   ![](/files/bwPX7NXoyqBksVjgFGe4)
2. Call the function "toArray" and define the value of array.\
   value1 : 2\
   value2 : 1\
   value3 : 1\
   value4 : 1<br>

   ![](/files/KgjY3JqNf3BoOY5HxKBE)

### Result

4

## Links


---

# 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://docs.emobiq.com/emobiq-client/006-actions-and-visual-logic/action-reference/cordova/array/count.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.
