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

234
Vistas
Is "" ( empty-string ) equivalent to boolean false or a false(y) value?

Please explain a little bit on this topic. I have went through some articles but I have not satisfied with their explanations.

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

0

The empty string ("") returns falsy. An easy way to understand this is by using the logical AND operator

The logical AND operator

If the first object is falsy, it returns that object

console.log('' && 'hello') // falsy && 'hello' --> returns falsy empty string ('')
console.log('hi' && 'hello') // truthy && 'hello' --> returns 'hello'

  1. In the first console.log() the empty string is a falsy value and so it returns the empty string.

  2. In the second console.log() the non-empty string is a truthy value and so it returns the second string hello

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