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

# JSValueMakeString(_:_:)

Creates a JavaScript value of the string type.

```
func JSValueMakeString(_ ctx: JSContextRef!, _ string: JSStringRef!) -> JSValueRef!
```

## Parameters

`ctx`

The execution context to use.

`string`

The [`JSStringRef`](/documentation/JavaScriptCore/JSStringRef) to assign to the newly created [`JSValueRef`](/documentation/JavaScriptCore/JSValueRef). The newly created [`JSValueRef`](/documentation/JavaScriptCore/JSValueRef) retains `string`, and releases it upon garbage collection.

## Return Value

A [`JSValueRef`](/documentation/JavaScriptCore/JSValueRef) of the string type that represents the value of `string`.

## Discussion

---

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)