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

185
Visualizações
Can we declare with let or var inside of an if conditional statement?

It seems like we are allowed to declare variables inside of conditional statements with inferred globals:

if(xo = 30){
            let iffy = true;
        }

However, is there a way or are we allowed to declare a variable with an 'let' or 'var' inside of an conditional statement? It would be something like the following:

if(var xo = 30){
            let iffy = true;
        }

The above code throws an exception but it's showing what i'm trying to achieve. With for loops it does allow declaraton of variables with an 'let' and 'var' in it's conditional statement. Could we replicate this for an if loop?

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