# Variable(변수!)

## Variable

**변할 수 있는 (가변적인) 것으로 값을 담는 컨테이너 역활을한다.**&#x20;

```javascript
//변수 -> 생성하고 초기화하고 사용하면됨 

let a = 221; //  초기화
let b = a - 5 ; 
a = 3;
console.log(b  , a); // 216, 3
 
```

* 변를 초기화하거나 생성할때는 let을 서야하지만 이미 생성된것을 사용할때는 let을 쓰지 않아도 된다.
* 자바스크립트는 코드를 위에서 아래로 실행시킨다
* 값이 바뀌어도 되는것은 let을 사용하면 된다.&#x20;

### const

constant 는 상수라는 뜻이다. 상수는 안정적이며 변하지 않는다.&#x20;

```javascript
const a = 10; // a의 값은 변하지 않는다.
```

* 위와 똑같은 코드를 쓰면 에러가남 상수는 변할 수 없기때문이다.
* 주로 const를 사용하는것이 좋다.

### 주석

```javascript
// 한줄 주석
/* 여러줄 주석*/
```

### string

```javascript
const what = "Hello"; // string -> text 
```

### Boolean&#x20;

```javascript
const wat = true; // 0 false  1 true 참,거짓 텍스트가 아님.
```

### Number

```javascript
const wat = 777; 
```

### Float

```javascript
const qat = 55.1; //소수점있는 숫자.
```


---

# 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://leeboa.gitbook.io/study/undefined/variable.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.
