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

191
Vistas
How to simplify the expression "data && data.pwd && data.pwd.length"?

I'm sorry if this question has been asked several times and in much clearer terms, but I just don't know the technical term for what I'm looking for. I'm trying to write a conditional statement in the following way:

if (data && data.password && data.password.length > 7) {// Do something}

But I know there is a simpler way to write this. Something like

if (data?password?length > 7) {// Do something}

What would be the correct formulation? What is the technical term for this type of expressions?

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

Concept you are looking for is called Optional Chaining

You can modify to : data?.password?.length

about 4 years ago · Juan Pablo Isaza 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