JSObjectGetPropertyAtIndex(_:_:_:_:)
Gets a property from an object by numeric index.
Declaration
func JSObjectGetPropertyAtIndex(_ ctx: JSContextRef!, _ object: JSObjectRef!, _ propertyIndex: UInt32, _ exception: UnsafeMutablePointer<JSValueRef?>!) -> JSValueRef!Parameters
- ctx:
The execution context to use.
- object:
The Jsobjectref with the property you want to get.
- propertyIndex:
An integer value that is the property’s name.
- exception:
A pointer to a Jsvalueref to store an exception in, if any. Pass
NULLto discard any exception.
Return Value
The property’s value, if object has the property; otherwise, the undefined value.
Discussion
Calling JSObjectGetPropertyAtIndex(_:_:_:_:) is equivalent to calling JSObjectGetProperty(_:_:_:_:) with a string that contains propertyIndex, but JSObjectGetPropertyAtIndex(_:_:_:_:) provides optimized access to numeric properties.
See Also
Working with Objects
JSObjectCallAsConstructor(_:_:_:_:_:)JSObjectCallAsFunction(_:_:_:_:_:_:)JSObjectCopyPropertyNames(_:_:)JSObjectDeleteProperty(_:_:_:_:)JSObjectGetPrivate(_:)JSObjectGetProperty(_:_:_:_:)JSObjectGetPrototype(_:_:)JSObjectHasProperty(_:_:_:)JSObjectIsConstructor(_:_:)JSObjectIsFunction(_:_:)JSObjectMake(_:_:_:)JSObjectMakeArray(_:_:_:_:)JSObjectMakeConstructor(_:_:_:)JSObjectMakeDate(_:_:_:_:)JSObjectMakeError(_:_:_:_:)