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

# JSGlobalContextCopyName(_:)

Gets a copy of the name of a context.

```
func JSGlobalContextCopyName(_ ctx: JSGlobalContextRef!) -> JSStringRef!
```

## Parameters

`ctx`

The [`JSGlobalContextRef`](/documentation/JavaScriptCore/JSGlobalContextRef) with the name you want to get.

## Return Value

The name for `ctx`.

## Discussion

JavaScriptCore exposes the name of [`JSGlobalContextRef`](/documentation/JavaScriptCore/JSGlobalContextRef) for remote debugging to make it easier to identify the context you want to attach to.

---

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)