What is the difference between atomic and compound data types in JavaScript?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
JavaScript (well, ECMAScript) differentiates between “primitive values” and “objects”. I’m not entirely sure if that’s the same as what you’re thinking of, but I’m guessing so.
From the ECMAScript 5 specification, primitive values are defined as follows:
And objects are defined as follows:
Section 8 of the spec gives more details of all the types. In particular, note section 8.6:
And that’s the big difference – an object is effectively a map of keys and values. Primitive values are just that – values!