I need to check if there is any key in localStorage This code did not work
if (localStorage.user === undefined) { alert('There is no key!'); }
if (Object.keys(localStorage).length === 0) { alert('There is no key!'); }