---
title: "JSValueUnprotect(_:_:)"
framework: javascriptcore
role: symbol
role_heading: Function
path: "javascriptcore/jsvalueunprotect(_:_:)"
---

# JSValueUnprotect(_:_:)

Unprotects a JavaScript value from garbage collection.

## Declaration

```swift
func JSValueUnprotect(_ ctx: JSContextRef!, _ value: JSValueRef!)
```

## Parameters

- `ctx`: The execution context to use.
- `value`: The doc://com.apple.javascriptcore/documentation/JavaScriptCore/JSValueRef to unprotect.

## Discussion

Discussion You can protect a value multiple times and must unprotect it an equal number of times before it becomes eligible for garbage collection.

## See Also

### Supporting Garbage Collection

- [JSValueProtect(_:_:)](javascriptcore/jsvalueprotect(_:_:).md)
