Is Everything in JavaScript Really an Object?
· 4 min read
When I was learning JavaScript, I'd occasionally come across this claim in tutorials or discussion forums:
“In JavaScript, everything is an object.”
Without really thinking about it, I picked up the idea that all variables in JS were objects. Now that I use JavaScript extensively at work and understand it a little better, I wanted to come back to that claim.
Let's get the answer out of the way: it isn't correct.
But if you're reading this, you're probably like me: you want to know why people say “everything in JavaScript is an object,” what supports that argument, and what the counterarguments are. Let's look at both sides and clear up a few JavaScript concepts along the way.