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

926
Vistas
`{}.length` throws in Chrome but not Node?

{}.length throws in Chrome (and other browsers), while it returns undefined in Node.

I know something like Object.keys({}).length is the correct way to get the number of entries in an object, but I'm just more curious to understand why the browser API and the Node API are inconsistent here.

Maybe this has something to do with how parsing is performed? Both Chrome and Node use the V8 engine. My assumption was that this engine's parser is consistent between environments, but maybe it's not?

I wonder if it's intended, and has something to do with backwards compatibility, or unintended and might be rectified in the future.

about 4 years ago · Santiago Gelvez
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