My if/else statement recently keep giving me false even when it should return true.
See below my code:
const managerStatus = () =>{
const theManager = "Nick Halding";
console.log(theManager.length)
let managerCondition;
if(theManager.length<=0 || isNaN(theManager) || theManager === undefined){
managerCondition=false
}
else{
managerCondition=true
}
return managerCondition;
}
Can clearly see that the length of theManager is bigger than 0 and is not NaN but still return false. It should return true according to me