this..
taking poorly written code,
writing poorly written alternative,
but in less lines,
which now needs comments to decipher...
is not an argument.
it's a fallacy.
this..
taking poorly written code,
writing poorly written alternative,
but in less lines,
which now needs comments to decipher...
is not an argument.
it's a fallacy.
function login(user) { | |
if (!user) { | |
user = getFromLocalStorage('user'); | |
} | |
if (user) { | |
if (user.loggedIn && user.isAdmin) { | |
navigateTo('dashboard'); | |
} | |
else { | |
navigateTo('unauthorized'); | |
} | |
} | |
else { | |
navigateTo('unauthorized'); | |
} | |
} |
function login(user = getFromLocalStorage('user')) { | |
if (!user || !user.loggedIn || !user.isAdmin)) { | |
navigateTo('unauthorized'); | |
return; | |
} | |
navigateTo('dashboard'); | |
} |