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

# JSBigIntCreateWithString(_:_:_:)

```
func JSBigIntCreateWithString(_ ctx: JSContextRef, _ string: JSStringRef, _ exception: UnsafeMutablePointer<JSValueRef?>?) -> JSValueRef
```

## Parameters

`ctx`

The execution context to use.

`string`

The JSStringRef representation of an integer.

`exception`

A pointer to a JSValueRef in which to store an exception, if any. To reliable detect exception, initialize this to null before the call. Pass NULL if you do not care to store an exception.

## Return Value

A BigInt JSValue of the string, or NULL if an exception is thrown.

## Discussion

\abstract Creates a JavaScript BigInt with an integer represented in string.
\discussion This is equivalent to calling the `BigInt` constructor from JavaScript with a string argument.

---

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)