TechFeedTechFeed
Programming Languages

JavaScript ES2026 새 기능 정리

Pipeline Operator, Temporal API, Record & Tuple 등 ES2026 핵심 기능과 코드 예시.

한 줄 요약: ES2026은 Pipeline Operator, Temporal API 안정화, 새 배열 메서드, Pattern Matching 초안을 포함한다. 지금 당장 쓸 수 있는 기능과 아직 Stage 2~3에 머무는 기능을 구분해서 파악해야 한다.

이 글이 필요한 사람
  • 최신 JavaScript 문법을 실무 프로젝트에 도입하려는 프론트엔드/풀스택 개발자
  • Babel·TypeScript 트랜스파일 설정에서 어떤 플러그인이 필요한지 파악하려는 경우
  • 날짜/시간 처리에서 Date 객체 대신 현대적인 API로 전환하고 싶은 경우
  • 함수형 스타일 코드를 작성하는 팀에서 Pipeline Operator 도입 가능성을 검토하는 경우

※ 이 글은 TC39 프로포절 상태(2025년 기준)를 반영하며, 브라우저 지원 현황은 caniuse.comtc39.es에서 확인할 것을 권장합니다.

Pipeline Operator — 함수 체이닝을 선형으로

Pipeline Operator(|>)는 TC39 Stage 2 프로포절로, 함수 합성을 왼쪽에서 오른쪽으로 읽을 수 있게 만든다. 현재 Hack Pipeline 방식(오른쪽 표현식에서 %로 이전 값 참조)이 표준 방향으로 채택됐다.

기존 코드에서 중첩 함수 호출이 많은 데이터 변환 파이프라인은 안에서 밖으로 읽어야 하는 불편함이 있었다. Pipeline Operator는 이를 위에서 아래, 왼쪽에서 오른쪽으로 읽히는 선형 흐름으로 바꾼다.

Pipeline Operator — 기존 방식 vs |> 방식 비교
// 기존: 중첩 함수 호출 — 안에서 밖으로 읽어야 함 const result = formatOutput(filterActive(normalizeData(parseInput(rawData)))); // Pipeline Operator (Hack Pipeline, Babel 플러그인 필요) const result = rawData |> parseInput(%) |> normalizeData(%) |> filterActive(%) |> formatOutput(%); // 비동기 파이프라인도 자연스럽게 표현 가능 const user = userId |> await fetchUser(%) |> await fetchPermissions(%) |> formatUserDisplay(%); // Babel 설정 (proposal-pipeline-operator) // babel.config.json // { "plugins": [["@babel/plugin-proposal-pipeline-operator", // { "proposal": "hack", "topicToken": "%" }]] }

Temporal API — Date를 대체하는 날짜/시간 처리

Temporal API(TC39 Stage 3)는 30년 된 Date 객체의 모든 문제를 해결하는 새 날짜/시간 API다. 타임존 처리, 달력 시스템, 불변(immutable) 객체, 명확한 타입 구분이 특징이다.

Date 객체의 주요 문제점:

  • Mutable — 실수로 수정 가능
  • 타임존이 로컬과 UTC만 지원 (IANA 타임존 없음)
  • 월이 0-indexed (1월 = 0)
  • 파싱 동작이 브라우저마다 다름
  • 날짜 산술이 직관적이지 않음
Temporal API 주요 예시
// PlainDate — 시간 없이 날짜만 const today = Temporal.Now.plainDateISO(); const nextWeek = today.add({ days: 7 }); console.log(nextWeek.toString()); // 2026-03-22 // ZonedDateTime — 타임존 포함 const meeting = Temporal.ZonedDateTime.from({ timeZone: 'Asia/Seoul', year: 2026, month: 3, day: 20, hour: 14, minute: 0 }); // 다른 타임존으로 변환 const nyTime = meeting.withTimeZone('America/New_York'); console.log(nyTime.toString()); // 날짜 차이 계산 const start = Temporal.PlainDate.from('2026-01-01'); const end = Temporal.PlainDate.from('2026-12-31'); const diff = start.until(end); console.log(diff.days); // 364 // Polyfill 사용 (현재) // npm install @js-temporal/polyfill import { Temporal } from '@js-temporal/polyfill';

Record and Tuple — 불변 자료구조

Record(#{ })와 Tuple(#[ ])은 불변(immutable) 복합 자료구조를 언어 레벨에서 지원하는 프로포절(Stage 2)이다. 기존 객체·배열과 달리 값 기반 동등 비교가 가능해 React state 비교, 메모이제이션, 캐시 키 등에 유용하다.

핵심 차이: 일반 { a: 1 } === { a: 1 }false지만, #{ a: 1 } === #{ a: 1 }true다. 참조가 아닌 값 자체로 비교된다.

Record and Tuple 사용 예시
// Record — 불변 객체 리터럴 const point = #{ x: 1, y: 2 }; const point2 = #{ x: 1, y: 2 }; console.log(point === point2); // true (값 비교) // Tuple — 불변 배열 const colors = #['red', 'green', 'blue']; const colors2 = #['red', 'green', 'blue']; console.log(colors === colors2); // true // 수정 시 새 Record/Tuple 반환 const moved = #{ ...point, x: 5 }; console.log(point.x); // 1 (원본 불변) console.log(moved.x); // 5 // Map 키로 사용 가능 (참조가 아닌 값 기반) const cache = new Map(); cache.set(#{ userId: 1, role: 'admin' }, 'data'); console.log(cache.get(#{ userId: 1, role: 'admin' })); // 'data'

새 Array 메서드 — 이미 Stage 4 완료

ES2023에 도입돼 ES2025~2026에 안정화된 배열 메서드들이 있다. 이미 주요 브라우저에서 지원되므로 폴리필 없이 사용 가능하다.

Array.fromAsync (ES2024 완료): 비동기 이터러블을 배열로 변환한다. for await...of + push 패턴을 한 줄로 줄인다.

Iterator Helpers (Stage 3 → 4): 이터레이터에 .map(), .filter(), .take() 등을 직접 사용할 수 있다. 중간 배열 생성 없이 지연(lazy) 평가로 처리된다.

Object.groupBy / Map.groupBy (ES2024): 배열을 특정 기준으로 그룹화하는 메서드. 기존에 reduce로 구현하던 패턴을 한 줄로 처리한다.

새 Array/Iterator 메서드 예시
// Array.fromAsync — 비동기 이터러블 → 배열 async function* generate() { yield 1; yield 2; yield 3; } const arr = await Array.fromAsync(generate()); // [1, 2, 3] // Iterator Helpers — 지연 평가, 중간 배열 없음 const result = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] .values() .filter(n => n % 2 === 0) .map(n => n * n) .take(3) .toArray(); // [4, 16, 36] // Object.groupBy const people = [ { name: 'Alice', dept: 'eng' }, { name: 'Bob', dept: 'design' }, { name: 'Carol', dept: 'eng' } ]; const byDept = Object.groupBy(people, p => p.dept); // { eng: [Alice, Carol], design: [Bob] } // Array.prototype.toSorted / toReversed / toSpliced — 원본 불변 const nums = [3, 1, 2]; const sorted = nums.toSorted(); // [1, 2, 3] console.log(nums); // [3, 1, 2] — 원본 유지

Pattern Matching — switch를 대체하는 구조적 매칭

Pattern Matching(match 표현식, Stage 2)은 Rust나 Haskell의 패턴 매칭을 JavaScript에 도입하는 프로포절이다. switch와 달리 구조 분해, 타입 체크, 가드 조건을 조합해 복잡한 분기 로직을 선언적으로 표현할 수 있다.

현재 공식 JS 런타임에서는 지원되지 않으며 Babel 플러그인을 통해 실험적으로 사용 가능하다. 문법은 최종 확정 전이므로 프로덕션 도입은 시기상조다.

Pattern Matching 문법 예시 (실험적)
// 현재 switch로 작성하는 복잡한 분기 function handleResponse(response) { switch (true) { case response.status === 200 && response.data !== null: return processData(response.data); case response.status === 404: return notFound(); case response.status >= 500: return serverError(response.status); default: return unknownError(); } } // Pattern Matching으로 표현 (제안 문법) function handleResponse(response) { return match (response) { when ({ status: 200, data: not null }) => processData(response.data), when ({ status: 404 }) => notFound(), when ({ status: (s) if s >= 500 }) => serverError(s), default => unknownError() }; }
Stage별 실무 적용 기준: Stage 4는 바벨 없이 최신 브라우저·Node.js에서 바로 사용 가능. Stage 3은 주요 엔진이 구현 중이므로 폴리필 또는 Babel로 사용 가능. Stage 2 이하(Pipeline Operator, Pattern Matching, Record & Tuple)는 프로덕션 도입 전에 문법 변경 가능성과 번들러 지원 여부를 반드시 확인할 것.

브라우저·Node.js 지원 현황 요약

기능TC39 StageChromeFirefoxNode.jsBabel/트랜스파일
Array.fromAsyncStage 4 (ES2024)121+115+22+불필요
Object.groupByStage 4 (ES2024)117+119+21+불필요
Iterator HelpersStage 4 (ES2025)122+131+22+불필요
Temporal APIStage 3미지원실험적미지원폴리필 필요
Pipeline OperatorStage 2미지원미지원미지원Babel 플러그인
Record & TupleStage 2미지원미지원미지원Babel 플러그인
Pattern MatchingStage 2미지원미지원미지원실험적 플러그인

※ 지원 버전은 변경될 수 있으므로 caniuse.com에서 최신 상태를 확인할 것.

toSorted / toReversed / with — 이미 사용 가능: ES2023에 확정된 Array.prototype.toSorted(), toReversed(), toSpliced(), with()는 원본 배열을 변경하지 않는 불변 버전 메서드다. Chrome 110+, Node.js 20+에서 이미 지원된다. React state 업데이트에서 스프레드 연산자 대신 사용할 수 있다.
JavaScriptES2026PipelineTemporal프로그래밍

관련 포스트

TypeScript vs JavaScript — 2026년 어떤 것을 선택할까2026-03-09Python 3.13 새 기능 총정리2026-03-08Zig 언어 입문 — C의 대안이 될 수 있을까2026-03-11웹 개발자를 위한 Rust 입문2026-02-28