Instance Method


Invokes the value as a JavaScript function.


func call(withArguments arguments: [Any]!) -> JSValue!



The parameters to pass to the function. The objects in this array must be other JSValue objects or objects that can be converted to JavaScript values using the methods listed in Creating JavaScript Values.

Return Value

The result of calling the value as a function, or nil if the value cannot be treated as a JavaScript function.


In JavaScript, if a function does not explicitly return a value, it implicitly returns the value undefined—use the isUndefined property to test for this result.

See Also

Working with Function and Constructor Values

func construct(withArguments: [Any]!) -> JSValue!

Invokes the value as a JavaScript constructor.

func invokeMethod(String!, withArguments: [Any]!) -> JSValue!

Calls the named JavaScript method on the value.

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software