DEV Community

Discussion on: Is everything in JavaScript an Object?

Collapse
 
mayankav profile image
mayankav

@lilithkarapetyan Hello Lilit! To answer your question, I'd say it completely depends on how a particular language defines primitives and objects. In JS, objects are nothing more than collective key:value pairs and anything that is not an object is a primitive. Consider another language, maybe 'C', it maps primitive types much closer to the underlying microprocessor architecture (int, char etc..). Generally in computer science "primitives" emply atomic types but then every programming language can freely decide on how to implement their own basic building block. For example Python chose to keep objects at the atomic level. So yeah, it depends on the language.