Instance Method

atIndex(_:)

Returns the value at the specified numeric index in the JavaScript object value.

Declaration

func atIndex(_ index: Int) -> JSValue!

Parameters

index

An index in the JavaScript object.

Return Value

The value at the specified index, or the JavaScript undefined value if no property exists at that index.

Discussion

Calling this method is equivalent to using the subscript operator with a numeric subscript in JavaScript. Use it to access elements of JavaScript arrays or of objects with numerically-indexed properties.

See Also

Working with Container Values

func defineProperty(String!, descriptor: Any!)

Defines a property on the JavaScript object value or modifies a property’s definition.

func hasProperty(String!) -> Bool

Returns a Boolean value indicating whether the JavaScript value has a defined property with the specified name.

func deleteProperty(String!) -> Bool

Deletes the named property from the JavaScript object value.

func setValue(Any!, at: Int)

Sets the value at the specified numeric index in the JavaScript object value.

func forProperty(String!) -> JSValue!

Returns the value of the named property in the JavaScript object value.

func setValue(Any!, forProperty: String!)

Sets the value of the named property in the JavaScript object value.