Contents

JSObjectMakeArray(_:_:_:_:)

Creates a JavaScript array object.

Declaration

func JSObjectMakeArray(_ ctx: JSContextRef!, _ argumentCount: Int, _ arguments: UnsafePointer<JSValueRef?>!, _ exception: UnsafeMutablePointer<JSValueRef?>!) -> JSObjectRef!

Parameters

  • ctx:

    The execution context to use.

  • argumentCount:

    An integer count of the number of arguments in arguments.

  • arguments:

    A Jsvalueref array of data to populate the array with. Pass NULL if argumentCount is 0.

  • exception:

    A pointer to a Jsvalueref to store an exception in, if any. Pass NULL to discard any exception.

Return Value

A JSObjectRef that is an array.

Discussion

The behavior of this function doesn’t exactly match the behavior of the built-in array constructor. Specifically, if you supply one argument, this function returns an array with one element.

See Also

Working with Objects