---
title: "Discussion on \"[Snippet] 배열 생성하기\" | Hashnode"
description: "Discussion on \"[Snippet] 배열 생성하기\". 1. Array.from\nlet num = Array.from({ length: n }, (_, i) => i + 1)\n\n\nlength가 n인 배열을 만들고, 각 요소를 1부터 n까지 채워줌\n\n순회 가능 또는 유사 배열 객체에서 얕게 복사된 새로운 배열 인스턴스 생성\n\n\n2. Array와 fill, map\nlet num = Array(n).fill(0).map((_, i) => i + 1);\n\n\nArray(n)은 n 길이의 빈 배열을 생성하고,..."
url: "https://hashnode.com/posts/make-array/671f0a79273b4743faf64f0d"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [\[Snippet\] 배열 생성하기](https://kykim.hashnode.dev/make-array?utm_source=hashnode&utm_medium=feed)

1\. Array.from let num = Array.from({ length: n }, (\_, i) => i + 1) length가 n인 배열을 만들고, 각 요소를 1부터 n까지 채워줌 순회 가능 또는 유사 배열 객체에서 얕게 복사된 새로운 배열 인스턴스 생성 2. Array와 fill, map let num = Array(n).fill(0).map((\_, i) => i + 1); Array(n)은 n 길이의 빈 배열을 생성하고,...

Oct 28, 2024 · 1 min read · kykim.hashnode.dev  
Read the article

-   [#array](https://hashnode.com/tag/array)

## Written by

[Kayoung](https://hashnode.com/@kayoungkim)

@kayoungkim · Seoul, Korea

  
[View profile](https://hashnode.com/@kayoungkim)

Frontend Developer

프론트엔드 개발자 김가영입니다. 개발과 일에 대한 생각을 주로 씁니다. https://velog.io/@kykim\_dev/posts (2023 이전 블로깅)

## Responses

Markdown supported · ⌘↵ to post

No responses yet.
