LogoSEO Jing
  • All Posts
  • SEO Jing
  • okayJing
  • KD Team
  • CLAB Coreteam
  • Study

Contact Me

© 2026 SEOJing. All rights reserved.

사전 진단 퀴즈 4단계 (배열, 함수, 비동기)

2026년 6월 28일·3분 읽기
Subtitle fallback
Subtitle component omitted
Paragraph fallback
Paragraph component omitted
Paragraph fallback
Paragraph component omitted
Paragraph fallback
Paragraph component omitted

---

Subtitle fallback
Subtitle component omitted
Subtitle fallback
Subtitle component omitted
Paragraph fallback
Paragraph component omitted
Subtitle fallback
Subtitle component omitted
Paragraph fallback
Paragraph component omitted
Subtitle fallback
Subtitle component omitted

<strong>정답</strong>: 결과물을 새로운 배열로 반환해 주는 map 메서드를

사용해야 합니다.

<strong>풀이 과정</strong>: forEach는 단순히 배열의 요소를 한 번씩 순회하며

특정 동작을 실행할 뿐, 작업이 끝나면 undefined를 반환합니다. 반면 map은 기존 배열의 각 요소를 가공하여 똑같은 길이의 '새로운 배열'을 만들어냅니다.

Subtitle fallback
Subtitle component omitted
Paragraph fallback
Paragraph component omitted
jsx
// React 컴포넌트 내부에서의 map 활용
const products = [
  { id: 1, name: "노트북" },
  { id: 2, name: "마우스" },
];

function ProductList() {
  return (
    <ul>
      {products.map((product) => (
        <li key={product.id}>{product.name}</li>
      ))}
    </ul>
  );
}

---

Subtitle fallback
Subtitle component omitted
Subtitle fallback
Subtitle component omitted
Paragraph fallback
Paragraph component omitted
Subtitle fallback
Subtitle component omitted
Paragraph fallback
Paragraph component omitted
Subtitle fallback
Subtitle component omitted

<strong>정답</strong>: 조건식에 지우고자 하는 글의 id와 일치하지 않는 데이터만

통과시키도록 작성하여 새로운 배열을 만듭니다.

<strong>풀이 과정</strong>: filter 메서드는 배열을 순회하며 조건식이 true를

반환하는 요소들만 모아 새로운 배열을 생성합니다. 원본 배열은 그대로 유지되므로 안전하게 데이터를 가공할 수 있습니다.

Subtitle fallback
Subtitle component omitted
Paragraph fallback
Paragraph component omitted
Paragraph fallback
Paragraph component omitted
javascript
// React에서의 삭제 기능 구현 패턴
const posts = [
  { id: 1, title: "첫 글" },
  { id: 2, title: "두 번째 글" },
];
const deleteId = 1;

// id가 1이 아닌 글만 남겨서 새로운 상태 배열로 만듦
const newPosts = posts.filter((post) => post.id !== deleteId);
// 결과: [{ id: 2, title: "두 번째 글" }]

---

Subtitle fallback
Subtitle component omitted
Subtitle fallback
Subtitle component omitted
Paragraph fallback
Paragraph component omitted
Subtitle fallback
Subtitle component omitted
Paragraph fallback
Paragraph component omitted
Subtitle fallback
Subtitle component omitted

<strong>정답</strong>: 일반 함수는 누가 어떻게 호출했느냐에 따라 this가

동적으로 변하지만, 화살표 함수는 자신이 선언된 위치의 상위 스코프의 this를 영구적으로 물려받습니다(Lexical this).

<strong>풀이 과정</strong>: 자바스크립트의 일반 함수에서 this는 함수를 호출한

객체를 가리킵니다. 그래서 콜백 함수로 넘겨지는 순간 호출자가 브라우저나 전역 객체로 바뀌어 this를 잃어버리는 일이 잦습니다. 하지만 화살표 함수는 고유의 this를 아예 가지지 않기 때문에, 언제나 자기가 태어난 환경의 this를 가리킵니다.

Subtitle fallback
Subtitle component omitted
Paragraph fallback
Paragraph component omitted

---

Subtitle fallback
Subtitle component omitted
Subtitle fallback
Subtitle component omitted
Paragraph fallback
Paragraph component omitted
Subtitle fallback
Subtitle component omitted
Paragraph fallback
Paragraph component omitted
Subtitle fallback
Subtitle component omitted

<strong>정답</strong>: 데이터를 요청하는 API 함수 앞에 await 키워드를 붙이고,

그 코드를 감싸는 상위 함수에 async 키워드를 붙여 데이터가 도착할 때까지 다음 코드의 실행을 일시 정지시킵니다.

<strong>풀이 과정</strong>: 자바스크립트는 기본적으로 네트워크 통신처럼 오래

걸리는 작업이 끝나기를 기다려주지 않고 바로 다음 줄의 코드를 실행해 버립니다(비동기). 이를 우리가 글을 읽는 것처럼 순서대로(동기적으로) 흐르게 만들어주는 도구가 바로 async/await입니다.

javascript
// React 컴포넌트 내부에서의 데이터 통신 패턴
async function fetchWeather() {
  try {
    // 데이터를 받아올 때까지 이 줄에서 대기
    const response = await fetch("https://api.weather.com/...");
    const data = await response.json();

    // 데이터를 다 받아오면 비로소 상태 업데이트
    setWeatherState(data);
  } catch (error) {
    console.log("데이터를 불러오지 못했습니다.");
  }
}
Subtitle fallback
Subtitle component omitted
Paragraph fallback
Paragraph component omitted

---

Subtitle fallback
Subtitle component omitted
Paragraph fallback
Paragraph component omitted

MDN Web Docs: Array.prototype.map()

MDN Web Docs: 화살표 함수

MDN Web Docs: async와 await

Post Q&A

오케이징에게 물어보기

사전 진단 퀴즈 4단계 (배열, 함수, 비동기) 전체를 기준으로 질문과 피드백을 받아요.답을 본 뒤에는 이 내용을 댓글로 달아서 서징에게도 물어볼 수 있어요. 작성자가 직접 볼 수 있어요!

0/500

포스트 목록

/study/clab-26-1/preclass
파일 5개, 폴더 0개
사전 진단 퀴즈 1단계 (HTML/CSS)사전 진단 퀴즈 2단계 (HTML/CSS 활용)사전 진단 퀴즈 3단계 (변수와 DOM)사전 진단 퀴즈 4단계 (배열, 함수, 비동기)사전 진단 퀴즈 5단계 (선언적 UI와 상태)

같은 섹션의 대표 이미지

5 posts · latest first
Study26. 03. 19.

사전 진단 퀴즈 3단계 (변수와 DOM).

스터디 커리큘럼 방향을 정하기 위한 세 번째 사전 진단 퀴즈입니다. 자바스크립트의 스코프, 참조 타입의 메모리 할당, DOM 제어와 이벤트 흐름 등 React 실무의 근간이 되는 CS 지식을 점검합니다.

26. 03. 19.SEOJing
Study26. 03. 19.

사전 진단 퀴즈 4단계 (배열, 함수, 비동기).

스터디 커리큘럼 방향을 정하기 위한 마지막 사전 진단 퀴즈입니다. React 컴포넌트를 다루기 위해 필수적인 배열 고차 함수(map, filter)와 비동기 통신(async/await) 능력을 점검합니다.

26. 03. 19.SEOJing
Study26. 03. 19.

사전 진단 퀴즈 5단계 (선언적 UI와 상태).

스터디 커리큘럼 방향을 정하기 위한 마지막 사전 진단 퀴즈입니다. 선언적 UI, 상태(State), 단방향 데이터 흐름, 부수 효과(Side Effect) 등 React 생태계 진입을 위한 필수 개념을 점검합니다.

26. 03. 19.SEOJing
Study26. 03. 18.

사전 진단 퀴즈 1단계 (HTML/CSS).

스터디 커리큘럼 방향을 정하기 위한 첫 번째 사전 진단 퀴즈입니다. HTML 태그 구조부터 CSS 박스 모델까지, 실무와 React 환경에서 이 기초들이 왜 중요한지 점검합니다.

26. 03. 18.SEOJing
Study26. 03. 18.

사전 진단 퀴즈 2단계 (HTML/CSS 활용).

스터디 커리큘럼 방향을 정하기 위한 두 번째 사전 진단 퀴즈입니다. 시맨틱 마크업, 폼 이벤트 제어, CSS 우선순위, Flexbox 레이아웃 등 실전 활용 능력을 점검합니다.

26. 03. 18.SEOJing