# Literals , Identifiers, Variables

### Literals

We define as **literal** a value that is written in the source code, for example, a number, a string, a boolean, or also more advanced constructs we will see later during the course, like Object Literals or Array Literals:

```jsx
5
'Test'
true

['a', 'b'] 
{color: 'red', shape: 'Rectangle'}
```

This is the simplest “unit” of JavaScript.

### Identifiers

An **identifier** is a sequence of characters.

We’ll use identifiers to identify a variable, a function, or an object.

An identifier can start with a letter, the dollar sign `$`, or an underscore `_`, and it can contain digits.

```jsx
Test
test
TEST
_test
Test1
$test
```

The dollar sign is commonly used to reference DOM elements.

Some names are reserved for JavaScript internal use, and we can’t use them as identifiers.

### Variables

When we need to have a reference to a value, we assign it to a **variable**.

The variable can have a name, and the value is what’s stored in a variable, so we can later access that value through the variable name.

A variable is a value assigned to an identifier, so you can reference and use it later in the program.

This is because JavaScript is **loosely typed**, a concept you’ll frequently hear about.

We have 3 main ways to declare variables. The first is to use `const`:

```jsx
const a = 0
```

The second way is to use `let`:

```jsx
let a = 0
```

We also have `var`:

```jsx
var a = 0
```

It’s important to note that identifiers are case sensitive.


---

# 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://docs.bashschool.in/v1/javascript/basics/literals-identifiers-variables.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.
