'Current if/else statement not working correctly and I don't know why not
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
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
