> For the complete documentation index, see [llms.txt](https://docs.emobiq.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.emobiq.com/emobiq-client/006-actions-and-visual-logic/action-reference/cordova/array/count.md).

# 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".

   ![](https://399701567-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FwmJ1RKjM2uNFaL6fO3Xu%2Fuploads%2Fgit-blob-7d29c49001d018509a5a6b6f7c40e51f9d15954e%2Fcount-step-1.png?alt=media)
2. Call the function "toArray" and define the value of array.\
   value1 : 2\
   value2 : 1\
   value3 : 1\
   value4 : 1<br>

   ![](https://399701567-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FwmJ1RKjM2uNFaL6fO3Xu%2Fuploads%2Fgit-blob-c63e8004375251cf094d2054ce58b1c18a2a6215%2Fcount-step-2.png?alt=media)

### Result

4

## Links
