---
title: JSContextGroupCreate()
framework: javascriptcore
role: symbol
role_heading: Function
path: javascriptcore/jscontextgroupcreate()
---

# JSContextGroupCreate()

Creates a JavaScript context group.

## Declaration

```swift
func JSContextGroupCreate() -> JSContextGroupRef!
```

## Return Value

Return Value The created JSContextGroupRef.

## Discussion

Discussion A JSContextGroupRef associates JavaScript contexts with one another. Contexts in the same group may share and exchange JavaScript objects. Sharing and exchanging JavaScript objects between contexts in different groups produces undefined behavior. When you use objects from the same context group in multiple threads, explicit synchronization is a requirement.

## See Also

### Creating a Context Group

- [JSContextGroupRetain(_:)](javascriptcore/jscontextgroupretain(_:).md)
- [JSContextGroupRelease(_:)](javascriptcore/jscontextgrouprelease(_:).md)
