Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

244
Visualizações
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

about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda