Amazon Developer

as

Settings
Sign out
Notifications
Alexa
Amazon Appstore
Ring
AWS
Documentation
Support
Contact Us
My Cases
Get Started
Design and Develop
Publish
Reference
Support
Native
Skip to main content

Interface IJsArray

interface IJsArray
Extends com.amazon.apmf.IStandard Immutable JavaScript Array. Each element of the array can be of any valid JavaScript dynamic type.

Methods

getElementCount()

i32 getElementCount()
Get the number of elements in the array.

Returns

i32 i32

getElementType()

JsType getElementType(i32 index)
Get the type of the element at this index.

Parameters

index
i32 — Required

Returns

JsType JsType

Throws

  • OutOfBoundsError — Thrown when attempting to access an element outside the bounds of the array.

isNull()

bool isNull(i32 index)
Check whether the element at this index is null.

Parameters

index
i32 — Required

Returns

bool bool

Throws

  • OutOfBoundsError — Thrown when attempting to access an element outside the bounds of the array.

isUndefined()

bool isUndefined(i32 index)

Parameters

index
i32 — Required

Returns

bool bool Check whether the element at this index is undefined.

Throws

  • OutOfBoundsError — Thrown when attempting to access an element outside the bounds of the array.

getString()

string getString(i32 index)

Parameters

index
i32 — Required

Returns

string string Get the string element (in UTF-8 encoding) at this index.

Throws

  • OutOfBoundsError — Thrown when attempting to access an element outside the bounds of the array.
  • JsTypeMismatchError — Thrown when attempting to get an element of a type, other than String.

getBool()

bool getBool(i32 index)

Parameters

index
i32 — Required

Returns

bool bool Get the boolean element at this index.

Throws

  • OutOfBoundsError — Thrown when attempting to access an element outside the bounds of the array.
  • JsTypeMismatchError — Thrown when attempting to get an element of a type, other than Bool.

getDouble()

double getDouble(i32 index)

Parameters

index
i32 — Required

Returns

double double Get the IEEE 754 double element at this index. JavaScript NaN is mapped to one of IEEE 754 NaNs. JavaScript +/- infinities are mapped to +/- infinities in IEEE 754. When an Int is retrieved as a Double, the exact value is preserved, and no exception is thrown.

Throws

  • OutOfBoundsError — Thrown when attempting to access an element outside the bounds of the array.
  • JsTypeMismatchError — Thrown when attempting to get an element of a type, other than Double or Int.

getInt()

i64 getInt(i32 index)

Parameters

index
i32 — Required

Returns

i64 i64 Get the signed 64-bit integer element at this index. Guaranteed to return an integer value that is, within the following bounds: Number.MIN_SAFE_INTEGER -(2**53 - 1) and Number.MAX_SAFE_INTEGER (2**53 - 1). When a Double is retrieved as an Int, the value is got after a loss in precision. However, no exception is thrown.

Throws

  • OutOfBoundsError — Thrown when attempting to access an element outside the bounds of the array.
  • JsTypeMismatchError — Thrown when attempting to get an element of a type, other than Int or Double.

getArray()

IJsArray* getArray(i32 index)

Parameters

index
i32 — Required

Returns

IJsArray* IJsArray Get the IJsArray element at this index.

Throws

  • OutOfBoundsError — Thrown when attempting to access an element outside the bounds of the array.
  • JsTypeMismatchError — Thrown when attempting to get an element of a type, other than Array.

getObject()

IJsObject* getObject(i32 index)

Parameters

index
i32 — Required

Returns

IJsObject* IJsObject Get the IJsObject element at this index.

Throws

  • OutOfBoundsError — Thrown when attempting to access an element outside the bounds of the array.
  • JsTypeMismatchError — Thrown when attempting to get an element of a type, other than Object.

Last modified on October 29, 2026