Skip to content

JSArray.At

boxgaming edited this page Jul 25, 2026 · 6 revisions

Takes an integer value and returns the item at that index, allowing for positive and negative integers. Negative integers count back from the last item in the array.

Syntax

result = JSArray.At (a, index%)

Parameters

  • The a parameter contains the native Javascript array on which the operation will be performed.
  • index% specifies the 0-based index of the item to retrieve from the array. Negative integers count back from the last item in the array.

Example

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

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

Print JSArray.At(colors, 0)
Print JSArray.At(colors, 2)
Print JSArray.At(colors, -1)
Print JSArray.At(colors, -3)

Output

red
blue
white
orange

See Also

JSArray.Create
JSArray.Item
Javascript - Array.at()

Clone this wiki locally