getItem( key ) method

Retrieves the value associated with a specified key.

Syntax

getItem( key ) → {String}

Parameters

Name Type Description
key String String key corresponding to the requested value.

Returns

A String value corresponding to the key, or null if either the key is not known, or if the key exists but its value was set to null.

[/reference/refbody/section/sectiondiv {""})

Type:

String

(sectiondiv]

Example

// Create the SUP Storage
var store = new hwc.SUPStorage ("one");
store.setItem ("foo", "bar"); // add an item.
result = store.getItem ("foo"); // will returns "bar".
result = store.getItem ("foo1"); // foo1 does not exists; will return null.

Source

SUPStorage.js, line 170.