Tutorial: Work with application data storage

Work with application data storage

Set new item or update an existing one:

stbStorage.setItem('key', 123);

Get item value by name:

console.log('item value by name:', stbStorage.getItem('key'));

Get item value by index:

var name = stbStorage.key(32);

if ( name ) {
    console.log('item value:', stbStorage.getItem(name));
} else {
    console.log('key was not found');
}

Remove some item:

stbStorage.removeItem('key');

Get all stored items amount:

console.log('all stored items amount:', stbStorage.length);

Clear all items:

stbStorage.clear();