getItem( )


Gets an item from local, session, or memory storage.

If an item does not exist, getItem() resolves to null.

Method Declaration
Copy
function getItem(key: string): string;
Method Parameters
keystringRequired

The key of the item to get.

Returns
Return Type:string
JavaScript
import { local } from "wix-storage-frontend"; // ... let value = local.getItem("key"); // "value"
Errors

This method doesn’t return any custom errors, but may return standard errors. Learn more about standard Wix errors.

Did this help?