GetItem Local Storage не существует
if (localStorage.getItem("username") === null) {
//...
}
Strange Starling
if (localStorage.getItem("username") === null) {
//...
}