---
title: "JSGlobalContextCopyName(_:)"
framework: javascriptcore
role: symbol
role_heading: Function
path: "javascriptcore/jsglobalcontextcopyname(_:)"
---

# JSGlobalContextCopyName(_:)

Gets a copy of the name of a context.

## Declaration

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

## Parameters

- `ctx`: The doc://com.apple.javascriptcore/documentation/JavaScriptCore/JSGlobalContextRef with the name you want to get.

## Return Value

Return Value The name for ctx.

## Discussion

Discussion JavaScriptCore exposes the name of JSGlobalContextRef for remote debugging to make it easier to identify the context you want to attach to.

## See Also

### Managing the context’s name

- [JSGlobalContextSetName(_:_:)](javascriptcore/jsglobalcontextsetname(_:_:).md)
