## MemoryStorage class

The MemoryStorage class is a minimal in-memory implementation of the Storage interface.

**Signature:**

```typescript
export declare class MemoryStorage implements Storage
```

**Implements:** Storage

## Constructors

| Constructor | Modifiers | Description |
| --- | --- | --- |
| [(constructor)()](/content/docs/sdk/core.memorystorage._constructor_/index.html) |  | Constructs a new instance of the `MemoryStorage` class |

## Properties

| Property | Modifiers | Type | Description |
| --- | --- | --- | --- |
| [length](/content/docs/sdk/core.memorystorage.length) | `readonly` | number | Returns the number of key/value pairs. |

## Methods

| Method | Modifiers | Description |
| --- | --- | --- |
| [clear()](/content/docs/sdk/core.memorystorage.clear) |  | Removes all key/value pairs, if there are any. |
| [getItem(key)](/content/docs/sdk/core.memorystorage.getitem) |  | Returns the current value associated with the given key, or null if the given key does not exist. |
| [key(index)](/content/docs/sdk/core.memorystorage.key) |  | Returns the name of the nth key, or null if n is greater than or equal to the number of key/value pairs. |
| [removeItem(key)](/content/docs/sdk/core.memorystorage.removeitem) |  | Removes the key/value pair with the given key, if a key/value pair with the given key exists. |
| [setItem(key, value)](/content/docs/sdk/core.memorystorage.setitem) |  | Sets the value of the pair identified by key to value, creating a new key/value pair if none existed for key previously. |

- [MemoryStorage class](/content/docs/sdk/core.memorystorage#memorystorage-class/index.html)
- [Constructors](/content/docs/sdk/core.memorystorage#constructors/index.html)
- [Properties](/content/docs/sdk/core.memorystorage#properties/index.html)
- [Methods](/content/docs/sdk/core.memorystorage#methods/index.html)
