---
title: "JSValueToStringCopy(_:_:_:)"
framework: javascriptcore
role: symbol
role_heading: Function
path: "javascriptcore/jsvaluetostringcopy(_:_:_:)"
---

# JSValueToStringCopy(_:_:_:)

Converts a JavaScript value to a string and copies the result into a JavaScript string.

## Declaration

```swift
func JSValueToStringCopy(_ ctx: JSContextRef!, _ value: JSValueRef!, _ exception: UnsafeMutablePointer<JSValueRef?>!) -> JSStringRef!
```

## Parameters

- `ctx`: The execution context to use.
- `value`: The doc://com.apple.javascriptcore/documentation/JavaScriptCore/JSValueRef to convert.
- `exception`: A pointer to a doc://com.apple.javascriptcore/documentation/JavaScriptCore/JSValueRef to store an exception in, if any. Pass NULL to discard any exception.

## Return Value

Return Value A JSStringRef with the result of conversion, or NULL if the system throws an exception. Ownership follows The Create Rule.

## See Also

### Converting to Primitive Values

- [JSValueToBoolean(_:_:)](javascriptcore/jsvaluetoboolean(_:_:).md)
- [JSValueToNumber(_:_:_:)](javascriptcore/jsvaluetonumber(_:_:_:).md)
- [JSValueToObject(_:_:_:)](javascriptcore/jsvaluetoobject(_:_:_:).md)
