# 배열 생성

빈 배열을 만드는 것은 아주 간단합니다:

```typescript
const foo: string[] = [];
```

내용을 채워서 배열을 만들고 있다면 ES6 `Array.prototype.fill` 을 사용하세요:

```typescript
const foo: string[] = new Array(3).fill('');
console.log(foo); // ['','',''];
```

함수를 호출해서 길이가 정해져 있는 배열을 만들고 싶다면 스프레드 연산자(...)를 사용하세요:

```typescript
const someNumbers = [...new Array(3)].map((_,i) => i * 10);
console.log(someNumbers); // [0,10,20];
```


---

# 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://radlohead.gitbook.io/typescript-deep-dive/main-1/create-arrays.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.
