<!--
{
  "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/JSValueIsEqual(_:_:_:_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Function",
  "symbol" : {
    "kind" : "Function",
    "modules" : [
      "JavaScriptCore"
    ],
    "preciseIdentifier" : "c:@F@JSValueIsEqual"
  },
  "title" : "JSValueIsEqual(_:_:_:_:)"
}
-->

# JSValueIsEqual(_:_:_:_:)

Tests whether two JavaScript values are equal.

```
func JSValueIsEqual(_ ctx: JSContextRef!, _ a: JSValueRef!, _ b: JSValueRef!, _ exception: UnsafeMutablePointer<JSValueRef?>!) -> Bool
```

## Parameters

`ctx`

The execution context to use.

`a`

The first value to test.

`b`

The second value to test.

`exception`

A pointer to a [`JSValueRef`](/documentation/JavaScriptCore/JSValueRef) to store an exception in, if any. Pass `NULL` to discard any exception.

## Return Value

<doc://com.apple.documentation/documentation/Swift/true> if the two values are equal according to the JavaScript `==` operator; <doc://com.apple.documentation/documentation/Swift/false> if they’re unequal or the system throws an exception.

## 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)