localStorage length
suggest changelocalStorage.length
property returns an integer number indicating the number of elements in the localStorage
Example:
Set Items
localStorage.setItem('StackOverflow', 'Documentation');
localStorage.setItem('font', 'Helvetica');
localStorage.setItem('image', 'sprite.svg');
Get length
localStorage.length; // 3
Found a mistake? Have a question or improvement idea?
Let me know.
Table Of Contents