<!--
{
  "availability" : [
    "iOS: 16.0.0 -",
    "iPadOS: 16.0.0 -",
    "macCatalyst: 13.0.0 -",
    "macOS: 10.5.0 -",
    "swift: -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "JavaScriptCore",
  "identifier" : "/documentation/JavaScriptCore/JSContext/init(JSGlobalContextRef:)-9m51",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "JavaScriptCore"
    ],
    "preciseIdentifier" : "c:objc(cs)JSContext(cm)contextWithJSGlobalContextRef:::SYNTHESIZED::c:objc(cs)JSContext"
  },
  "title" : "init(JSGlobalContextRef:)"
}
-->

# init(JSGlobalContextRef:)

Creates a JavaScript context object from the equivalent C representation.

```
init!(JSGlobalContextRef jsGlobalContextRef: JSGlobalContextRef!)
```

## Parameters

`jsGlobalContextRef`

A C JavaScript context reference.

## Return Value

A JavaScript context object representing the same context.

## Discussion

See `JSContextRef` for the C JavaScriptCore API.

---

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)