FlareStart
HomeNewsHow ToSources
FlareStart

Where developers start their day. All the tech news & tutorials that matter, in one place.

Quick Links

  • Home
  • News
  • Tutorials
  • Sources
  • Privacy Policy

Connect

© 2026 FlareStart. All rights reserved.

Back to articles
Why typeof( [ ] ) Returns "object" in JavaScript
How-ToWeb Development

Why typeof( [ ] ) Returns "object" in JavaScript

via Dev.to WebdevKathirvel S5h ago

If you’ve been writing JavaScript for even a short time, you’ve probably seen this: typeof [] // "object" And your brain immediately goes: Wait… what? That’s clearly an array. Why is JavaScript lying to me? Let’s break this down properly — not just the surface-level explanation, but the real reason this happens. First: JavaScript Has Only a Few Real Types In JavaScript, typeof only returns one of these values: " undefined " " boolean " " number " " string " " bigint " " symbol " " function " " object " Notice anything missing? There’s no "array" . That’s not an accident. Arrays Are Objects. Period. In JavaScript, arrays are not a separate primitive type. When you write: const arr = []; You’re actually doing: const arr = new Array (); And Array is a constructor that creates an object. So technically: typeof [] // "object" is completely correct. What Makes Arrays Special Then? If arrays are just objects, why do they behave differently? Because arrays are specialized objects with: Numeric

Continue reading on Dev.to Webdev

Opens in a new tab

Read Full Article
0 views

Related Articles

How to get the MacBook Neo $499 education price - qualifications to know
How-To

How to get the MacBook Neo $499 education price - qualifications to know

ZDNet • 1h ago

How I Made $30 in One Intraday Options Trade (My Exact Setup)
How-To

How I Made $30 in One Intraday Options Trade (My Exact Setup)

Medium Programming • 1h ago

MacBook Neo hands-on: Apple build quality at a substantially lower price
How-To

MacBook Neo hands-on: Apple build quality at a substantially lower price

Ars Technica • 1h ago

This 5.1 Soundbar Bundle Is $100 Off
How-To

This 5.1 Soundbar Bundle Is $100 Off

Wired • 1h ago

Automation in Software Development Without Breakdown
How-To

Automation in Software Development Without Breakdown

Medium Programming • 2h ago

Discover More Articles