---
title: "==(_:_:)"
framework: swift
role: symbol
role_heading: Operator
path: "swift/closedrange/==(_:_:)"
---

# ==(_:_:)

Returns a Boolean value indicating whether two ranges are equal.

## Declaration

```swift
static func == (lhs: ClosedRange<Bound>, rhs: ClosedRange<Bound>) -> Bool
```

## Parameters

- `lhs`: A range to compare.
- `rhs`: Another range to compare.

## Discussion

Discussion Two ranges are equal when they have the same lower and upper bounds. let x = 5...15 print(x == 5...15) // Prints "true" print(x == 10...20) // Prints "false"

## See Also

### Comparing Ranges

- [!=(_:_:)](swift/closedrange/!=(_:_:).md)
- [overlaps(_:)](swift/closedrange/overlaps(_:)-947dt.md)
- [overlaps(_:)](swift/closedrange/overlaps(_:)-7dfep.md)
