---
title: underestimatedCount
framework: swift
role: symbol
role_heading: Instance Property
path: swift/set/underestimatedcount
---

# underestimatedCount

A value less than or equal to the number of elements in the collection.

## Declaration

```swift
var underestimatedCount: Int { get }
```

## Discussion

Discussion note: O(1) if the collection conforms to RandomAccessCollection; otherwise, O(n), where n is the length of the collection.

## See Also

### Iterating over a Set

- [enumerated()](swift/set/enumerated().md)
- [forEach(_:)](swift/set/foreach(_:).md)
- [makeIterator()](swift/set/makeiterator().md)
