Verifique o valor variável e faça algo

// Long version  
if (isLoggedin) {   
    redirectToHomepage();   
}

//Shorthand  
isLoggedin && redirectToHomepage();   
Excited Emu