Breadcrumbs

count() Operation

Counts the number of elements in an array.

Syntax

anArray.count()

Semantics

Counts the number of elements in anArray. The count operation returns an Integer value. The count of an empty array is zero.

Substitutables

anArray

Can be any variable or object attribute having the type Array

Examples

Input: an array of names

JSON
{"names": ["Irene", "Eliza", "Raymond", "Jane", "David"]}
set size = names.count();

Result: size is 5.