why is it setting my local storage to 1400 in html code example
Example 1: localstorage javascript
localStorage.setItem(key, val);
var val = localStorage.getItem(key);
localStorage.removeItem(key);
localStorage.clear();
Example 2: localstorage
// using in HTML5 (frontend)
// set
localStorage.setItem('users', 'vilh');
users = [
{
id: 1,
name: 'vilh',
},
{
id: 2,
name: 'zidane'
},
]
// set string
localStorage.setItem('users', users); // stored objects
localStorage.setItem('users', JSON.stringify(users)); // stored string
// get
var retrievedUsername = localStorage.getItem('users');