GetItem Local Storage existiert nicht
if (localStorage.getItem("username") === null) {
//...
}
Strange Starling
if (localStorage.getItem("username") === null) {
//...
}