<!--
{
  "availability" : [
    "iOS: 16.0.0 -",
    "iPadOS: 16.0.0 -",
    "macCatalyst: 13.0.0 -",
    "macOS: 10.5.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "JavaScriptCore",
  "identifier" : "/documentation/JavaScriptCore/JSObjectMakeConstructor(_:_:_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Function",
  "symbol" : {
    "kind" : "Function",
    "modules" : [
      "JavaScriptCore"
    ],
    "preciseIdentifier" : "c:@F@JSObjectMakeConstructor"
  },
  "title" : "JSObjectMakeConstructor(_:_:_:)"
}
-->

# JSObjectMakeConstructor(_:_:_:)

Creates a JavaScript constructor.

```
func JSObjectMakeConstructor(_ ctx: JSContextRef!, _ jsClass: JSClassRef!, _ callAsConstructor: JSObjectCallAsConstructorCallback!) -> JSObjectRef!
```

## Parameters

`ctx`

The execution context to use.

`jsClass`

A [`JSClassRef`](/documentation/JavaScriptCore/JSClassRef) that is the class your constructor assigns to the objects its constructs. It uses `jsClass` to set the constructor’s `.prototype` property, and to evaluate `instanceof` expressions. Pass `NULL` to use the default object class.

`callAsConstructor`

A [`JSObjectCallAsConstructorCallback`](/documentation/JavaScriptCore/JSObjectCallAsConstructorCallback) to invoke when using your constructor in a `new` expression. Pass `NULL` to use the default object constructor.

## Return Value

A [`JSObjectRef`](/documentation/JavaScriptCore/JSObjectRef) that is a constructor. The object’s prototype is the default object prototype.

## Discussion

The default object constructor takes no arguments, and constructs an object of class `jsClass` with no private data.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)