# Primitives and objects

JavaScript divides data essentially into two main categories: *primitives* and *objects*.

Let's start by defining what a primitive is:

A *primitive* is one of the simplest forms of data.

A primitive value could be thought of as an *atom*, if you're familiar with chemistry from the old days at school. An atom is the simplest form of an element, and that's exactly what a primitive is in JavaScript.

The simplest example of primitive values would be numbers. Consider the value `10`. This, as you know, is a number in JavaScript. But most importantly, it's a primitive. It's one of the simplest values that can be represented in JavaScript.

The key characteristic of primitives, as we shall discover later on, is that they don't have any properties/methods attached to them. So when we say that `10` is a primitive value, we, in effect, mean that there are no properties/methods attached to this value `10`.

JavaScript comes equipped with 7 primitive data types: `undefined`, `null`, *numbers*, *strings*, *Booleans*, *Symbols*, and *BigInt*.

For this course, we'll only be concerned with the first five. The remaining two types are covered in our [Advanced JavaScript](https://www.codeguage.com/courses/advanced-js/) course.

On the other hand, an *object* is the mirror image of a primitive.

An *object* is a value composed of primitives.

Going with the analogy that a primitive resembles an atom, an object then resembles a molecule. A molecule is made up of atoms and so are objects, which are made up of primitives.

Simply put, if a value isn't a primitive in JavaScript, then it is an object. Apart form the seven primitive data types discussed above, *everything else* is an object in the language.

An object, unlike a primitive, can have properties/methods attached to it.

An object is sometimes also referred to as a *reference*. And by that means, the object type is also known as the *reference type*. That where does the term *'reference'* come from, we'll explore later on in this chapter.

Let's now start exploring the different primitive types in JavaScript before considering its object types.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://edrus.gitbook.io/mt-it/1st-month/week-3/javascript/datatypes/primitives-and-objects.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
