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

222
Vistas
if(1 == 1) if(1 == 'one') if(1 = 1) if(1===1) if(1==='1') which is true and why?
if(1 == 1)

if(1 == 'one')

if(1 = 1) 

if(1===1) 

if(1==='1')

I would like to know which is true and why?

about 4 years ago · Santiago Trujillo
1 Respuestas
Responde la pregunta

0

  1. First condition is true, because a number is always equal to itself.
  2. Second condition is a false statement as "one" does not get converted into number type (type coercion).
  3. Third condition will give error as '=' is an assignment operator and can't be used for comparison.
  4. Fourth condition is again true because a number is compared to itself.
  5. Fifth condition is a false statement, as strict equality ('===') checks for the value as well as the type of operand. First operand is a number but second is string. So it will evaluate to false.
about 4 years ago · Santiago Trujillo Denunciar
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