> For the complete documentation index, see [llms.txt](https://april.gitbook.io/learning-js/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://april.gitbook.io/learning-js/chapter-8./8.7.md).

# 8.7 문자열 병합

* Array.prototype.join은 매개변수로 구분자 하나를 받고 요소들을 하나로 합친 문자열을 반환
* 매개변수가 생략됐을 때의 기본값은 쉼표
* **문자열 요소를 합칠 때 정의되지 않은 요소, 삭제된 요소, null, undefined는 모두 빈 문자열로 취급**

```javascript
const arr = [1, null, "hello", "world", true, undefined];
delete arr[3]; // [1, null, "hello", 삭제됨, true, undefined];
arr.join(); // "1,,hello,,true";
arr.join(''); // "1hellotrue"
arr.join(' -- '); // "1 -- -- hello -- -- true -- "
```
