# 6.3 함수와 매개변수

* 함수를 호출하면서 정보를 전달할 경우 함수 매개면수 (argument, parameter) 이용
* 매개변수는 함수가 호출되기 전에는 존재하지 않는다는 점을 제외하면 일반적인 변수와 같음
* 다만 원시 값은 불변이므로 수정할 수 없음 (원시 값을 담은 변수는 수정할 수 있지만 값 자체는 바뀌지 않음)

```javascript
function f(o) {
    o.message = `f 안에서 수정함 (이전 값: '${o.message}')`;
}

let o = {
    message: "초기 값"
};

console.log(`f를 호출하기 전: o.message = "${o.message}"`);
f(o);
console.log(`f를 호출한 다음: o.message = "${o.message}"`);
```

### 결과

```bash
f를 호출하기 전: o.message = "초기 값"
f를 호출한 다음: o.message = "f 안에서 수정함 (이전 값: '초기 값')"
```


---

# 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://april.gitbook.io/learning-js/chapter-6./6.3.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.
