Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

187
Vistas
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 la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda