# Basic JavaScript

## 변수에 관하여

> In JavaScript all variables and function names are case sensitive. This means that capitalization matters.

### 변수에는 카멜 표기법을 사용

> Write variable names in JavaScript in ***camelCase***. In ***camelCase***, multi-word variable names have the first word in lowercase and the first letter of each subsequent word is capitalized.

{% hint style="info" %}
변수의 **첫 글자**는 **소문자**로 쓰고 이후 단어의 첫 글자 마다 대문자를 쓴다.
{% endhint %}

### 변수 선언 방식

&#x20;ES6 부터 var는 지양하고 가급적 let과 const를 사용

```javascript
const someVariable;
const anotherVariableName;
const thisVariableNameIsSoLong;
```

{% hint style="success" %}
1순위로 **const**를 사용하고 재할당이 필요한 경우만 **let**을 쓴다
{% endhint %}

#### reference

* [\[javascript\] ES6 반드시 알아야할 문법 let, const 차이점](https://smilerici.tistory.com/68)
* [\[ES6\] var, let 그리고 const](http://blog.nekoromancer.kr/2016/01/26/es6-var-let-%EA%B7%B8%EB%A6%AC%EA%B3%A0-const/)

## 주석 넣기

주석은 JavaScript가 의도적으로 무시하는 코드 행을 말함. 이를 통해 자신에게 필요한 메모와 코드를 읽는이를 위한 안내사항을 기록할 수 있음

### 한줄 주석 //

```javascript
// 다음은 주석입니다
```

### 여러줄 주석 /\*  \*/

```javascript
/* 여러줄의 
주석을 입력할때는
다음과 같이 합니다
*/
```


---

# 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://jihwan.gitbook.io/life101/javascript/basic-javascript.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.
