---
title: "member(_:)"
framework: foundation
role: symbol
role_heading: Instance Method
path: "foundation/nsset/member(_:)"
---

# member(_:)

Determines whether a given object is present in the set, and returns that object if it is.

## Declaration

```swift
func member(_ object: Any) -> Any?
```

## Parameters

- `object`: An object to look for in the set.

## Return Value

Return Value Returns an object equal to object if it’s present in the set, otherwise nil.

## Discussion

Discussion Each element of the set is checked for equality with object until a match is found or the end of the set is reached.  Objects are considered equal if isEqual(_:) returns true.

## See Also

### Accessing Set Members

- [allObjects](foundation/nsset/allobjects.md)
- [anyObject()](foundation/nsset/anyobject().md)
- [contains(_:)](foundation/nsset/contains(_:).md)
- [filtered(using:)](foundation/nsset/filtered(using:).md)
- [objectEnumerator()](foundation/nsset/objectenumerator().md)
- [enumerateObjects(_:)](foundation/nsset/enumerateobjects(_:).md)
- [enumerateObjects(options:using:)](foundation/nsset/enumerateobjects(options:using:).md)
- [objects(passingTest:)](foundation/nsset/objects(passingtest:).md)
- [objects(options:passingTest:)](foundation/nsset/objects(options:passingtest:).md)
