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

171
Vistas
How to transcribe this nullish coalescing operator with added equal mark to regular ternary operator

How would this shortcut nullish operator be in the plain ternary operator syntax

obj = obj[array[i]] ??= {}

What is confusing for me here is the added = after the two ??

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

0

The logical nullish assignment (x ??= y) operator only assigns if x is nullish (null or undefined).

in your question,

if obj[array[i]] equals to null or undefined, then obj[array[i]] will be {}.

checkout the mdn documentation:

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Logical_nullish_assignment

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