---
title: "compare(_:)"
framework: javascriptcore
role: symbol
role_heading: Instance Method
path: "javascriptcore/jsvalue/compare(_:)-35b2t"
---

# compare(_:)

## Declaration

```swift
func compare(_ other: Double) -> JSRelationCondition
```

## Return Value

Return Value A value of JSRelationCondition, a kJSRelationConditionUndefined is returned if an exception is thrown.

## Discussion

Discussion Compare a JSValue with a double. The JSValue is converted to a double according to the rules specified by the JavaScript language then compared with other.
