<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [worker-tls](./worker-tls.md) &gt; [SortQueue](./worker-tls.sortqueue.md) &gt; [add](./worker-tls.sortqueue.add.md)

## SortQueue.add() method

添加元素

**Signature:**

```typescript
add(item: Item): number;
```

## Parameters

<table><thead><tr><th>

Parameter


</th><th>

Type


</th><th>

Description


</th></tr></thead>
<tbody><tr><td>

item


</td><td>

Item


</td><td>


</td></tr>
</tbody></table>
**Returns:**

number

返回item最终的索引

