---
title: "JSObjectCallAsConstructor(_:_:_:_:_:)"
framework: javascriptcore
role: symbol
role_heading: Function
path: "javascriptcore/jsobjectcallasconstructor(_:_:_:_:_:)"
---

# JSObjectCallAsConstructor(_:_:_:_:_:)

Calls an object as a constructor.

## Declaration

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

## Parameters

- `ctx`: The execution context to use.
- `object`: The doc://com.apple.javascriptcore/documentation/JavaScriptCore/JSObjectRef to call as a constructor.
- `argumentCount`: An integer count of the number of arguments in arguments.
- `arguments`: A doc://com.apple.javascriptcore/documentation/JavaScriptCore/JSValueRef array of arguments to pass to the constructor. Pass NULL if argumentCount is 0.
- `exception`: A pointer to a doc://com.apple.javascriptcore/documentation/JavaScriptCore/JSValueRef to store an exception in, if any. Pass NULL to discard any exception.

## Return Value

Return Value The JSObjectRef that results from calling object as a constructor, or NULL if the system throws an exception or object isn’t a constructor.

## See Also

### Working with Objects

- [JSObjectCallAsFunction(_:_:_:_:_:_:)](javascriptcore/jsobjectcallasfunction(_:_:_:_:_:_:).md)
- [JSObjectCopyPropertyNames(_:_:)](javascriptcore/jsobjectcopypropertynames(_:_:).md)
- [JSObjectDeleteProperty(_:_:_:_:)](javascriptcore/jsobjectdeleteproperty(_:_:_:_:).md)
- [JSObjectGetPrivate(_:)](javascriptcore/jsobjectgetprivate(_:).md)
- [JSObjectGetProperty(_:_:_:_:)](javascriptcore/jsobjectgetproperty(_:_:_:_:).md)
- [JSObjectGetPropertyAtIndex(_:_:_:_:)](javascriptcore/jsobjectgetpropertyatindex(_:_:_:_:).md)
- [JSObjectGetPrototype(_:_:)](javascriptcore/jsobjectgetprototype(_:_:).md)
- [JSObjectHasProperty(_:_:_:)](javascriptcore/jsobjecthasproperty(_:_:_:).md)
- [JSObjectIsConstructor(_:_:)](javascriptcore/jsobjectisconstructor(_:_:).md)
- [JSObjectIsFunction(_:_:)](javascriptcore/jsobjectisfunction(_:_:).md)
- [JSObjectMake(_:_:_:)](javascriptcore/jsobjectmake(_:_:_:).md)
- [JSObjectMakeArray(_:_:_:_:)](javascriptcore/jsobjectmakearray(_:_:_:_:).md)
- [JSObjectMakeConstructor(_:_:_:)](javascriptcore/jsobjectmakeconstructor(_:_:_:).md)
- [JSObjectMakeDate(_:_:_:_:)](javascriptcore/jsobjectmakedate(_:_:_:_:).md)
- [JSObjectMakeError(_:_:_:_:)](javascriptcore/jsobjectmakeerror(_:_:_:_:).md)
