---
title: "JSValueIsEqual(_:_:_:_:)"
framework: javascriptcore
role: symbol
role_heading: Function
path: "javascriptcore/jsvalueisequal(_:_:_:_:)"
---

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

Tests whether two JavaScript values are equal.

## Declaration

```swift
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 doc://com.apple.javascriptcore/documentation/JavaScriptCore/JSValueRef to store an exception in, if any. Pass NULL to discard any exception.

## Return Value

Return Value true if the two values are equal according to the JavaScript == operator; false if they’re unequal or the system throws an exception.

## See Also

### Comparing Values

- [JSValueIsStrictEqual(_:_:_:)](javascriptcore/jsvalueisstrictequal(_:_:_:).md)
- [JSValueIsInstanceOfConstructor(_:_:_:_:)](javascriptcore/jsvalueisinstanceofconstructor(_:_:_:_:).md)
