---
title: "isEqualWithTypeCoercion(to:)"
framework: javascriptcore
role: symbol
role_heading: Instance Method
path: "javascriptcore/jsvalue/isequalwithtypecoercion(to:)"
---

# isEqualWithTypeCoercion(to:)

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

## Declaration

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

## Parameters

- `value`: The value to be compared against.

## Return Value

Return Value true if the values are equivalent; otherwise, false.

## Discussion

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.

## See Also

### Comparing JavaScript Values

- [isEqual(to:)](javascriptcore/jsvalue/isequal(to:).md)
- [isInstance(of:)](javascriptcore/jsvalue/isinstance(of:).md)
