Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

930
Views
`{}.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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!