<!--
{
  "availability" : [
    "iOS: 7.0.0 -",
    "iPadOS: 7.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.9.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "JavaScriptCore",
  "identifier" : "/documentation/JavaScriptCore/JSValue/isEqualWithTypeCoercion(to:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "JavaScriptCore"
    ],
    "preciseIdentifier" : "c:objc(cs)JSValue(im)isEqualWithTypeCoercionToObject:"
  },
  "title" : "isEqualWithTypeCoercion(to:)"
}
-->

# isEqualWithTypeCoercion(to:)

Compares the value to another for equivalence, allowing type conversion.

```
func isEqualWithTypeCoercion(to value: Any!) -> Bool
```

## Parameters

`value`

The value to be compared against.

## Return Value

<doc://com.apple.documentation/documentation/Swift/true> if the values are equivalent; otherwise, <doc://com.apple.documentation/documentation/Swift/false>.

## Discussion

This method is analogous to the equality operator `==` in JavaScript: it first converts its operands to the same type (if they are not already of the same type), then applies a strict equality comparison to the result. JavaScript object values are equal if and only if they refer to the same object instance.

---

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)