Skip to content

JSArray.Length

boxgaming edited this page Jul 6, 2026 · 1 revision

Returns the number of elements in a given array.

Syntax

arrayLength% = JSArray.Length ( a )

Parameters

  • The a parameter contains the native Javascript array on which the operation will be performed.

Example

Import JSArray From "lib/lang/array.bas"

Dim colors As Object
colors = JSArray.Create("red", "green", "blue", "orange", "yellow", "white")
Print JSArray.Length(colors)

JSArray.Clear colors

Print JSArray.Length(colors)

Output

6
0

See Also

JSArray.Create
JSArray.Clear

Clone this wiki locally