---
title: "call(withArguments:)"
framework: javascriptcore
role: symbol
role_heading: Instance Method
path: "javascriptcore/jsvalue/call(witharguments:)"
---

# call(withArguments:)

Invokes the value as a JavaScript function.

## Declaration

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

## Parameters

- `arguments`: The parameters to pass to the function. The objects in this array must be other doc://com.apple.javascriptcore/documentation/JavaScriptCore/JSValue objects or objects that can be converted to JavaScript values using the methods listed in the Creating JavaScript Values section in doc://com.apple.javascriptcore/documentation/JavaScriptCore/JSValue.

## Return Value

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

## Discussion

Discussion 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

- [construct(withArguments:)](javascriptcore/jsvalue/construct(witharguments:).md)
- [invokeMethod(_:withArguments:)](javascriptcore/jsvalue/invokemethod(_:witharguments:).md)
