Array.length Last updated: 27. Aug 2024

Returns the number of elements in an array.

Parameters

This function takes no parameters

Returns

The length of the array.

Example

Data

{
"items" : ["Red", "Green", "Blue"]
}

Code example (#JS)

#JS is mixed HTML (or other text file) with inline JavaScript with # starting and ending each inline statement.
<p>
    // Expected result: 3
    #items.length#    
</p>

Output

The #JS code above produces the output shown below:
<p>
    // Expected result: 3
    3    
</p>