javascript - How to check if window.localStorage contains any values -


how check if window.localstorage contains any values?

something :

if(window.localstorage.hasitems()){        // } 

you can use length property of storage interface

if(localstorage.length){ } 

Comments