# Add(T)

> Adds a new value. If the value is already present in the collection, this method should throw, but currently does not! Instead, it returns false without replacing said item.

## Definition

* **Type:** Method
* **Namespace:** [Unity.Collections](/engine/6000.7/script-reference/unity/collections.md)
* **Assembly:** UnityEngine.ManagedKernelModule

```csharp
public bool Add(T item)
```

### Parameters

**** (T): The value to add.

### Returns

| Type                                                          | Description                                |
| ------------------------------------------------------------- | ------------------------------------------ |
| [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | True if the value was not already present. |

### Remarks

Prefer [NativeHashSet\<T>.TryAdd](/engine/6000.7/script-reference/unity/collections/nativehashset1/tryadd.md) if your intent is to allow graceful failure, as this API will eventually become more strict (and begin to throw).
