SharedPreferences

SharedPreferences Class The `SharedPreferences` class provides methods for local persistent storage.

Constructor

new SharedPreferences()

Example
// Write & Read any
SharedPreferences.write("test_key", "test_value");
const value = SharedPreferences.read("test");
console.log(value);

Methods

(static) read(key) → {any}

Reads the value associated with the specified key from disk.
Parameters:
NameTypeDescription
keystringThe key to read the value from.
Returns:
- The value associated with the key, or null if the key does not exist.
Type: 
any

(static) write(key, value)

Writes the specified value to disk with the given key.
Parameters:
NameTypeDescription
keystringThe key to associate the value with.
valueanyThe value to write to disk.