Storage API

storage.get()

Gets the values from storage.

  • Accepts arguments as strings and arrays of strings.
    You can pass storage keys as individual arguments, as an array, or as a string separated by commas or spaces.
    Each value is seen as a new argument.
  • Returns a value from storage if a single argument is passed and an object containing storage values if multiple arguments or no arguments are passed.
    If the storage is empty or if there is no value in the storage, it will be null.
Example:
storage.get();
// null if empty.
// {key1: 'book', key2: 10, key3: {book: 'name', cat: [1, 2], elements: [<div>, <span>]}}

storage.get('key4');
// null

storage.get('key1');
// 'book'

storage.get('key3');
// {book: 'name', cat: [1, 2], elements: [<div>, <span>]}

storage.get('key1', 'key4');
// {key1: 'book', key4: null}

storage.get('key1', 'key2');
storage.get(['key1', 'key2']);
storage.get('key1, key2');
storage.get('key1 key2');
// {key1: 'book', key2: 10}