---
title: slot_clear
description: Free up a currently occupied slot
---
import { Tabs, TabItem } from '@astrojs/starlight/components';

### Behaviour

* Free the specified slot, releasing any object that was slotted there

### Definition

<Tabs>
<TabItem label="C">
```c
int64_t slot_clear (
    uint32_t slot_no
);
```
</TabItem>

<TabItem label="JavaScript">
```javascript
function slot_clear(slotno: number): ErrorCode | number
```
</TabItem>
</Tabs>



### Example

<Tabs>
<TabItem label="C">
```c
slot_clear(1); // assumes a transaction is slotted into slot=1
```
</TabItem>

<TabItem label="JavaScript">
```javascript
slot_clear(1) // assumes a transaction is slotted into slot=1
```
</TabItem>
</Tabs>



### Parameters

<Tabs>
<TabItem label="C">
| Name     | Type      | Description     |
| -------- | --------- | --------------- |
| slot_no | uint32_t | The slot number |
</TabItem>

<TabItem label="JavaScript">
| Name   | Type   | Description     |
| ------ | ------ | --------------- |
| slotno | number | The slot number |
</TabItem>
</Tabs>



### Return Code

<Tabs>
<TabItem label="C">
| Type     | Description                                                                                                                                                               |
| -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| int64_t | <p><code>1</code> or an error<br /><br />If negative, an error:<br /><code>DOESNT_EXIST</code><br />- the specified slot does not contain any object or it is an invalid slot</p> |
</TabItem>

<TabItem label="JavaScript">
| Type                | Description                                                 |
| ------------------- | ----------------------------------------------------------- |
| ErrorCode \| number | Returns an error code or the result of the clear operation. |
</TabItem>
</Tabs>

