# i++와 ++i 의 차이

1. i++

기존의 i값을 사용하고 i값을 증가시킨다.

```javascript
i=0;
alert(i++);//실행시 0이 출력된다.
//i가 증가하는 것은 alert실행 이후에 실행된다.
```

2\. ++i

i값을 증가시키고 난 후 i값을 사용한다.

```javascript
i=0;
alert(++i);//실행시 1이 출력된다.
//i가 증가되고 난 후 alert가 실행된다.
```


---

# 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://heunnajo.gitbook.io/javascript/i++-++i.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.
